style: simplify teacher shortcuts to text actions

This commit is contained in:
鲨鱼辣椒
2026-09-29 23:48:21 +08:00
parent fef3b3aa9b
commit fd0b7205d7
4 changed files with 32 additions and 13 deletions

View File

@@ -62,15 +62,20 @@ for (const width of [319, 508]) {
await expect(shortcuts.first()).toHaveCSS('font-size', await panel.getByTestId('teacher-reply').first().evaluate(el => getComputedStyle(el).fontSize));
await expect(shortcuts.first()).toHaveCSS('font-weight', '400');
await expect(shortcuts.first()).toHaveCSS('border-top-width', '0px');
await expect(shortcuts.first()).not.toHaveCSS('box-shadow', 'none');
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);
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('transform', 'matrix(1, 0, 0, 1, 0, -1)');
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('transform', 'none');
await page.mouse.down();
await expect(shortcuts.first()).toHaveCSS('transform', 'matrix(1, 0, 0, 1, 0, 1)');
await expect(shortcuts.first()).toHaveCSS('color', 'rgb(36, 55, 39)');
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);
await page.mouse.up();
await page.emulateMedia({ reducedMotion: 'reduce' });
@@ -142,7 +147,8 @@ for (const width of [319, 508]) {
await expect(hint).toBeEnabled();
await expect(hint).toHaveText('帮我整体看🧠');
expect(await hint.evaluate(el => el.scrollWidth <= el.clientWidth && el.scrollHeight <= el.clientHeight)).toBe(true);
await expect(hint).toHaveCSS('background-color', 'rgb(248, 230, 183)');
await expect(hint).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)');
await expect(hint).toHaveCSS('box-shadow', 'none');
const initialSend = (await send.boundingBox())!;
const hintBounds = (await hint.boundingBox())!;
expect(hintBounds.x).toBeLessThan(initialSend.x);