-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e1abfd
commit 3b1b97a
Showing
16 changed files
with
1,137 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 35 additions & 27 deletions
62
...t/hooks/kent.c.dodds-epic-react/07.suspense/02.data-fetching/suspense-data-fetching.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,42 @@ | ||
import '@cypress/skip-test/support' | ||
import App from './suspense-data-fetching' | ||
|
||
// does not work reliably in CI | ||
it.skip( | ||
'suspense, data fetching, error boundary', | ||
{ viewportHeight: 600, defaultCommandTimeout: 15000 }, | ||
() => { | ||
cy.intercept('POST', 'https://graphql-pokemon2.vercel.app/', (req) => | ||
req.reply({ | ||
body: { | ||
data: { | ||
pokemon: { | ||
id: 'UG9rZW1vbjowMjU=', | ||
number: '025', | ||
name: 'Pikachu', | ||
image: 'https://img.pokemondb.net/artwork/pikachu.jpg', | ||
attacks: { | ||
special: [ | ||
{ name: 'Discharge', type: 'Electric', damage: 35 }, | ||
{ name: 'Thunder', type: 'Electric', damage: 100 }, | ||
{ name: 'Thunderbolt', type: 'Electric', damage: 55 } | ||
] | ||
describe('Suspense, data fetching, error boundary', () => { | ||
before(() => { | ||
cy.task('isCi').then((isCi) => { | ||
cy.skipOn(isCi) | ||
}) | ||
}) | ||
it( | ||
'suspense, data fetching, error boundary', | ||
{ viewportHeight: 600, defaultCommandTimeout: 15000 }, | ||
() => { | ||
cy.intercept('POST', 'https://graphql-pokemon2.vercel.app/', (req) => | ||
req.reply({ | ||
body: { | ||
data: { | ||
pokemon: { | ||
id: 'UG9rZW1vbjowMjU=', | ||
number: '025', | ||
name: 'Pikachu', | ||
image: 'https://img.pokemondb.net/artwork/pikachu.jpg', | ||
attacks: { | ||
special: [ | ||
{ name: 'Discharge', type: 'Electric', damage: 35 }, | ||
{ name: 'Thunder', type: 'Electric', damage: 100 }, | ||
{ name: 'Thunderbolt', type: 'Electric', damage: 55 } | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}) | ||
).as('pika') | ||
cy.mount(<App />) | ||
}) | ||
).as('pika') | ||
cy.mount(<App />) | ||
|
||
cy.wait('@pika', { timeout: 15000 }) | ||
cy.getByCy('pokemon-info').should('be.visible') | ||
} | ||
) | ||
cy.wait('@pika', { timeout: 15000 }) | ||
cy.getByCy('pokemon-info').should('be.visible') | ||
} | ||
) | ||
}) |
10 changes: 9 additions & 1 deletion
10
cypress/component/hooks/usehooks.com/useLockBodyScroll/use-lock-body-scroll.comp-spec.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
...t/redux-FP-arch-with-React-Redux-book/ch13-newsApi-genericFlowWithBackend-Rtap/App.cy.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +0,0 @@ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands' | ||
import '@testing-library/cypress/add-commands' | ||
import 'cypress-real-events/support' | ||
import 'cypress-react-app-actions' | ||
// import 'cypress-axe' | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const isCI = require('is-ci') | ||
|
||
const isCi = () => isCI | ||
|
||
export default isCi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// an example task that logs to the CLI console | ||
// cy.task('log', 'e2e sanity passed') | ||
|
||
const log = (x: string) => { | ||
console.log(x) | ||
|
||
return null | ||
} | ||
|
||
export default log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const cyGrep = require('@bahmutov/cy-grep/src/plugin') | ||
|
||
/** | ||
* The collection of plugins to use with Cypress | ||
* @param on `on` is used to hook into various events Cypress emits | ||
* @param config `config` is the resolved Cypress config | ||
*/ | ||
export default function plugins(on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) { | ||
return { | ||
// add plugins here | ||
// ...cyDataSession(on, config), // example | ||
...cyGrep(config) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import log from './log' | ||
import isCi from './is-ci' | ||
|
||
/** | ||
* The collection of tasks to use with `cy.task()` | ||
* @param on `on` is used to hook into various events Cypress emits | ||
*/ | ||
export default function tasks(on: Cypress.PluginEvents) { | ||
on('task', { log }) | ||
on('task', { isCi }) | ||
// add tasks here | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.