Skip to content

Commit 7d03705

Browse files
committed
test: update preview tests to expect app-no-prose class
1 parent fb5af5f commit 7d03705

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

scripts/generate-component-previews.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('component-preview-fixtures', () => {
9191
describe('buildPartialMdx', () => {
9292
it('wraps a single render in a component-preview div', () => {
9393
const result = buildPartialMdx([{ html: '<input class="govuk-input">' }])
94-
expect(result).toContain('className="component-preview"')
94+
expect(result).toContain('className="component-preview app-no-prose"')
9595
expect(result).toContain('dangerouslySetInnerHTML')
9696
expect(result).toContain('govuk-input')
9797
})
@@ -103,7 +103,7 @@ describe('buildPartialMdx', () => {
103103
])
104104
expect(result).toContain('Before payment')
105105
expect(result).toContain('After payment')
106-
const matches = result.match(/className="component-preview"/g)
106+
const matches = result.match(/className="component-preview app-no-prose"/g)
107107
expect(matches).toHaveLength(2)
108108
})
109109

@@ -199,7 +199,7 @@ describe('writePreviewPartial', () => {
199199
fixtures.PaymentField
200200
)
201201
const written = writeFileSync.mock.calls[0][1]
202-
const matches = written.match(/className="component-preview"/g)
202+
const matches = written.match(/className="component-preview app-no-prose"/g)
203203
expect(matches).toHaveLength(2)
204204
})
205205

scripts/generate-page-previews.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ describe('writePagePreviewPartial', () => {
130130
})
131131
expect(mockBuildPartialMdx).toHaveBeenCalledWith(
132132
[{ html: '<div>page html</div>' }],
133-
'component-preview component-preview--page'
133+
'component-preview component-preview--page app-no-prose'
134134
)
135135
})
136136

@@ -158,7 +158,7 @@ describe('writePagePreviewPartial', () => {
158158
{ label: 'No files uploaded', html: '<div>page html</div>' },
159159
{ label: 'With files uploaded', html: '<div>page html</div>' }
160160
],
161-
'component-preview component-preview--page'
161+
'component-preview component-preview--page app-no-prose'
162162
)
163163
})
164164

0 commit comments

Comments
 (0)