style: give teacher shortcuts distinct text colors

This commit is contained in:
鲨鱼辣椒
2026-09-30 00:07:20 +08:00
parent 83a19fb19f
commit b934945f26
4 changed files with 31 additions and 10 deletions

View File

@@ -66,15 +66,19 @@ for (const width of [319, 508]) {
await expect(shortcuts.first()).toHaveCSS('box-shadow', 'none');
await expect(shortcuts.first()).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)');
expect((await row.boundingBox())!.y + (await row.boundingBox())!.height).toBeLessThan((await composer.boundingBox())!.y);
const shortcutRows = await shortcuts.evaluateAll(elements => elements.map(el => ({ color: getComputedStyle(el).color, top: el.getBoundingClientRect().top, bottom: el.getBoundingClientRect().bottom })));
expect(new Set(shortcutRows.map(row => row.color)).size).toBe(8);
expect(await shortcuts.evaluateAll(elements => elements.every(el => el.scrollHeight <= el.clientHeight))).toBe(true);
expect(shortcutRows.every((row, index) => index === 0 || row.top >= shortcutRows[index - 1].bottom)).toBe(true);
await shortcuts.first().focus();
await expect(shortcuts.first()).toHaveCSS('outline-style', 'solid');
await expect(shortcuts.first()).toHaveCSS('cursor', 'pointer');
await shortcuts.first().hover();
await expect(shortcuts.first()).toHaveCSS('color', 'rgb(48, 70, 49)');
await expect(shortcuts.first()).toHaveCSS('text-decoration-color', 'rgb(48, 70, 49)');
await expect(shortcuts.first()).toHaveCSS('color', 'rgb(40, 79, 123)');
await expect(shortcuts.first()).toHaveCSS('text-decoration-color', 'rgb(40, 79, 123)');
await expect(shortcuts.first()).toHaveCSS('transform', 'none');
await page.mouse.down();
await expect(shortcuts.first()).toHaveCSS('color', 'rgb(36, 55, 39)');
await expect(shortcuts.first()).toHaveCSS('color', 'rgb(32, 63, 99)');
await expect(shortcuts.first()).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)');
await expect(shortcuts.first()).toHaveCSS('transform', 'none');
await page.mouse.move(0, 0);