|
1 | 1 | import { test, expect } from '@playwright/test'; |
2 | | -import { verifyPageLoads, createPageStructureSnapshot } from './test-utils'; |
| 2 | +import { verifyPageLoads, createPageStructureSnapshot, toNormalizedSnapshot } from './test-utils'; |
3 | 3 |
|
4 | 4 | /** |
5 | 5 | * Comprehensive tests that verify ALL collection items render correctly |
@@ -182,30 +182,30 @@ test.describe('Page Content Snapshots', () => { |
182 | 182 | await page.waitForLoadState('networkidle'); |
183 | 183 |
|
184 | 184 | const structure = await createPageStructureSnapshot(page); |
185 | | - expect(JSON.stringify(structure, null, 2)).toMatchSnapshot('all-home-structure.txt'); |
| 185 | + expect(toNormalizedSnapshot(structure)).toMatchSnapshot('all-home-structure.txt'); |
186 | 186 | }); |
187 | 187 |
|
188 | 188 | test('events page content snapshot', async ({ page }) => { |
189 | 189 | await page.goto('/events/'); |
190 | 190 | await page.waitForLoadState('networkidle'); |
191 | 191 |
|
192 | 192 | const structure = await createPageStructureSnapshot(page); |
193 | | - expect(JSON.stringify(structure, null, 2)).toMatchSnapshot('all-events-structure.txt'); |
| 193 | + expect(toNormalizedSnapshot(structure)).toMatchSnapshot('all-events-structure.txt'); |
194 | 194 | }); |
195 | 195 |
|
196 | 196 | test('sponsors page content snapshot', async ({ page }) => { |
197 | 197 | await page.goto('/sponsors/'); |
198 | 198 | await page.waitForLoadState('networkidle'); |
199 | 199 |
|
200 | 200 | const structure = await createPageStructureSnapshot(page); |
201 | | - expect(JSON.stringify(structure, null, 2)).toMatchSnapshot('all-sponsors-structure.txt'); |
| 201 | + expect(toNormalizedSnapshot(structure)).toMatchSnapshot('all-sponsors-structure.txt'); |
202 | 202 | }); |
203 | 203 |
|
204 | 204 | test('speakers page content snapshot', async ({ page }) => { |
205 | 205 | await page.goto('/speakers/'); |
206 | 206 | await page.waitForLoadState('networkidle'); |
207 | 207 |
|
208 | 208 | const structure = await createPageStructureSnapshot(page); |
209 | | - expect(JSON.stringify(structure, null, 2)).toMatchSnapshot('all-speakers-structure.txt'); |
| 209 | + expect(toNormalizedSnapshot(structure)).toMatchSnapshot('all-speakers-structure.txt'); |
210 | 210 | }); |
211 | 211 | }); |
0 commit comments