Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/fidelity/reference.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ describe.skipIf( Boolean( process.env.SKIP_BROWSER_TESTS ) || ! existsSync( chro
const browser = await chromium.launch(); const context = await browser.newContext( { viewport: { width: 1440, height: 900 } } );
try {
const page = await context.newPage(); await page.goto( url ); await page.setViewportSize( { width: 768, height: 900 } );
await page.waitForFunction( () => document.documentElement.dataset.pose === 'resized' );
expect( await page.locator( 'h1' ).evaluate( element => getComputedStyle( element ).fontSize ) ).toBe( '29px' );
const collector = createReferenceCollector( directory, url, [ url ], { cleanupPolicy: cleanupPolicy() } );
await collector.observe( page, url, 'desktop', [], { isMobile: false, hasTouch: false } );
Expand Down
5 changes: 4 additions & 1 deletion src/lib/screenshot/fluid-capture.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,10 @@ describe( 'learnAndApplyFluidGeometry', () => {
const heights: Record< number, number > = {};
for ( const width of [ 390, 600, 768, 1024, 1280, 1440, 1536, 1680, 1792, 1920 ] ) {
await source.setViewportSize( { width, height: 900 } );
await source.waitForTimeout( 10 );
await source.waitForFunction( () => {
const expected = innerWidth < 768 ? innerWidth === 390 ? '208px' : '100%' : `${ innerWidth * 0.23 }px`;
return document.querySelector< HTMLElement >( '#frame' )!.style.getPropertyValue( '--image-height' ) === expected;
} );
heights[ width ] = ( await source.locator( '#image' ).boundingBox() )!.height;
}
await learnAndApplyFluidGeometry( source, { settleMs: 30 } );
Expand Down
Loading