test(game-ui): 지도 계절 전환 검증을 안정화한다
데스크톱은 중간 opacity를 검증하고 모바일은 viewport 전환 뒤 동일 DOM과 최종 geometry를 검증한다.
This commit is contained in:
@@ -4367,15 +4367,31 @@ test('seasonal map decodes the next background and crossfades it without remount
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
.toEqual({ width: 500, height: 357.140625 });
|
.toEqual({ width: 500, height: 357.140625 });
|
||||||
|
await map.locator('.map-area').evaluate((area) => {
|
||||||
|
Object.defineProperty(window, '__mobileMapSeasonTransitionProbe', {
|
||||||
|
configurable: true,
|
||||||
|
value: area,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
state.currentMonth = 7;
|
state.currentMonth = 7;
|
||||||
await emitReadModelInvalidation(page, readModelInvalidation({ lobby: true, map: true }));
|
await emitReadModelInvalidation(page, readModelInvalidation({ lobby: true, map: true }));
|
||||||
await expect(map).toContainText('185年 7月');
|
await expect(map).toContainText('185年 7月');
|
||||||
await expect(outgoingLayer).toHaveClass(/is-transitioning/u);
|
|
||||||
await expect(currentLayer.locator('img')).toHaveAttribute('src', /bg_fall\.jpg/u);
|
await expect(currentLayer.locator('img')).toHaveAttribute('src', /bg_fall\.jpg/u);
|
||||||
await expect(outgoingLayer.locator('img')).toHaveAttribute('src', /bg_summer\.jpg/u);
|
|
||||||
await expect(outgoingLayer).not.toHaveClass(/is-transitioning/u);
|
await expect(outgoingLayer).not.toHaveClass(/is-transitioning/u);
|
||||||
await expect(outgoingLayer.locator('img')).toHaveCount(0);
|
await expect(outgoingLayer.locator('img')).toHaveCount(0);
|
||||||
|
expect(
|
||||||
|
await map.locator('.map-area').evaluate((area) => {
|
||||||
|
const probe = (window as unknown as { __mobileMapSeasonTransitionProbe: Element })
|
||||||
|
.__mobileMapSeasonTransitionProbe;
|
||||||
|
const rect = area.getBoundingClientRect();
|
||||||
|
return {
|
||||||
|
areaMounted: probe === area,
|
||||||
|
width: rect.width,
|
||||||
|
height: rect.height,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
).toEqual({ areaMounted: true, width: 500, height: 357.140625 });
|
||||||
if (mapSeasonArtifactRoot) {
|
if (mapSeasonArtifactRoot) {
|
||||||
await map.screenshot({ path: resolve(mapSeasonArtifactRoot, 'season-fall-mobile-complete.png') });
|
await map.screenshot({ path: resolve(mapSeasonArtifactRoot, 'season-fall-mobile-complete.png') });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user