Skip to content

Commit

Permalink
upgrade to React 19
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Dec 5, 2024
1 parent 09973df commit 2b47db3
Show file tree
Hide file tree
Showing 8 changed files with 4,610 additions and 2,555 deletions.
3,430 changes: 2,180 additions & 1,250 deletions epicshop/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions epicshop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"test": "playwright test"
},
"dependencies": {
"@epic-web/config": "^1.5.4",
"@epic-web/config": "^1.16.3",
"@epic-web/workshop-app": "^5.9.0",
"@playwright/test": "^1.41.2",
"@playwright/test": "^1.49.0",
"cross-env": "^7.0.3"
}
}
4 changes: 3 additions & 1 deletion epicshop/update-deps.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
npx npm-check-updates --dep prod,dev --upgrade --root
rm -rf node_modules package-lock.json ./exercises/**/node_modules
cd epicshop && npx npm-check-updates --dep prod,dev --upgrade --root
cd ..
rm -rf node_modules package-lock.json ./epicshop/package-lock.json ./epicshop/node_modules ./exercises/**/node_modules
npm install
npm run setup
npm run typecheck
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ await testStep('can render the app', () => {

await testStep('Toggle is rendered and initially on', async () => {
const toggleElement = await screen.findByRole('switch')
expect(toggleElement).toHaveAttribute('aria-checked', 'true')
expect(toggleElement).toBeChecked()
})

await testStep('Toggle can be turned off', async () => {
const toggleElement = await screen.findByRole('switch')
await userEvent.click(toggleElement)
expect(toggleElement).toHaveAttribute('aria-checked', 'false')
expect(toggleElement).not.toBeChecked()
})

await testStep('Clicking reset turns the toggle back on', async () => {
const resetButton = await screen.findByRole('button', { name: /reset/i })
await userEvent.click(resetButton)
const toggleElement = await screen.findByRole('switch')
expect(toggleElement).toHaveAttribute('aria-checked', 'true')
expect(toggleElement).toBeChecked()
})
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ await testStep('can render the app', () => {

await testStep('Toggle is rendered and initially on', async () => {
const toggleElement = await screen.findByRole('switch')
expect(toggleElement).toHaveAttribute('aria-checked', 'true')
expect(toggleElement).toBeChecked()
})

await testStep('Toggle can be turned off', async () => {
const toggleElement = await screen.findByRole('switch')
await userEvent.click(toggleElement)
expect(toggleElement).toHaveAttribute('aria-checked', 'false')
expect(toggleElement).not.toBeChecked()
})

await testStep('Changing initialOn updates the initialOn option', async () => {
Expand All @@ -34,6 +34,6 @@ await testStep(
expect(
toggleElement,
'🚨 Did you forget to stablize the initalOn value?',
).toHaveAttribute('aria-checked', 'true')
).toBeChecked()
},
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, testStep } from '@epic-web/workshop-utils/test'
import { toggleReducer } from './toggle.tsx'

testStep('toggleReducer is exported', () => {
await testStep('toggleReducer is exported', () => {
expect(toggleReducer).to.be.a('function')
})
Loading

0 comments on commit 2b47db3

Please sign in to comment.