fix(game-ui): 공통 Lumen 버튼 모양을 통일한다
상하단 이동·갱신 제어와 장수 목록, 토너먼트, 명령 선택을 공통 semantic button family로 연결한다. 고정 행은 공통 fixed-height 변형이 hover와 active 높이를 보정하게 하고 실제 Chromium geometry 회귀를 추가한다.
This commit is contained in:
@@ -2186,7 +2186,43 @@ test('main cards and command input stay inside their Ref-sized grid slots', asyn
|
||||
await selectedMenu.evaluate((element) => ((element as HTMLDetailsElement).open = false));
|
||||
await expect(selectedMenu).not.toHaveAttribute('open', '');
|
||||
|
||||
await page.locator('[data-main-target="commands"] .select-command').click();
|
||||
const selectCommand = page.locator('[data-main-target="commands"] .select-command');
|
||||
await expect(selectCommand).toHaveClass(/legacy-button--info/u);
|
||||
await page.mouse.move(1, 1);
|
||||
const measureSelectCommand = () =>
|
||||
selectCommand.evaluate((element) => {
|
||||
const rect = element.getBoundingClientRect();
|
||||
const style = getComputedStyle(element);
|
||||
return {
|
||||
top: rect.top,
|
||||
bottom: rect.bottom,
|
||||
height: rect.height,
|
||||
marginTop: style.marginTop,
|
||||
borderBottomWidth: style.borderBottomWidth,
|
||||
borderRadius: style.borderRadius,
|
||||
backgroundColor: style.backgroundColor,
|
||||
};
|
||||
});
|
||||
const selectDefault = await measureSelectCommand();
|
||||
expect(selectDefault).toMatchObject({
|
||||
height: 34,
|
||||
marginTop: '0px',
|
||||
borderBottomWidth: '4px',
|
||||
borderRadius: '5.25px',
|
||||
backgroundColor: 'rgb(52, 152, 219)',
|
||||
});
|
||||
await selectCommand.hover();
|
||||
const selectHover = await measureSelectCommand();
|
||||
expect(selectHover).toMatchObject({ height: 33, marginTop: '1px', borderBottomWidth: '3px' });
|
||||
expect(selectHover.bottom).toBeCloseTo(selectDefault.bottom, 2);
|
||||
const selectBox = await selectCommand.boundingBox();
|
||||
if (!selectBox) throw new Error('select command control is not measurable');
|
||||
await page.mouse.move(selectBox.x + selectBox.width / 2, selectBox.y + selectBox.height / 2);
|
||||
await page.mouse.down();
|
||||
const selectActive = await measureSelectCommand();
|
||||
expect(selectActive).toMatchObject({ height: 32, marginTop: '2px', borderBottomWidth: '2px' });
|
||||
expect(selectActive.bottom).toBeCloseTo(selectDefault.bottom, 2);
|
||||
await page.mouse.up();
|
||||
const picker = page.getByTestId('command-picker');
|
||||
await expect(picker).toBeVisible();
|
||||
// The trigger can end up directly above a newly opened category button.
|
||||
|
||||
Reference in New Issue
Block a user