Skip to content

Commit

Permalink
use applyRequestHandlers in Storybook 7
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourgreens committed Oct 25, 2024
1 parent 4b35b76 commit ee80eec
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { within } from '@testing-library/dom'
import { render, screen } from '@testing-library/react'
import { composeStory } from '@storybook/react'
import { applyRequestHandlers } from 'msw-storybook-addon'
import nock from 'nock'

import Meta, { Default } from './SubjectPicker.stories.js'

describe('Components > Subject Picker', function () {
let columnHeadings, displayName, link, tableRows

before(async function () {
const DefaultStory = composeStory(Default, Meta)
await applyRequestHandlers(DefaultStory.parameters.msw)
render(<DefaultStory />)
displayName = await screen.findByText('Anti-Slavery Letters: 1800-1839')
link = screen.getByRole('link', { name: 'SubjectPicker.back' })
Expand Down

0 comments on commit ee80eec

Please sign in to comment.