Merge commit 'b934945f26f9539020490ab10bb0b4ac80a5e0a3' into codex/20260930-shortcut-style-merge-9ac716e4-shortcut-merge
This commit is contained in:
@@ -60,17 +60,27 @@ for (const width of [319, 508]) {
|
||||
const composer = panel.locator('.consultation-composer');
|
||||
await expect(composer.locator('.consultation-hint')).toHaveCount(0);
|
||||
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('font-weight', '600');
|
||||
await expect(shortcuts.first()).not.toHaveCSS('text-shadow', 'none');
|
||||
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);
|
||||
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('transform', 'matrix(1, 0, 0, 1, 0, -1)');
|
||||
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('transform', 'matrix(1, 0, 0, 1, 0, 1)');
|
||||
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);
|
||||
await page.mouse.up();
|
||||
await page.emulateMedia({ reducedMotion: 'reduce' });
|
||||
@@ -142,12 +152,13 @@ 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);
|
||||
expect(hintBounds.height).toBe(30);
|
||||
expect(hintBounds.y + hintBounds.height).toBeLessThan((await page.locator('.consultation-composer').boundingBox())!.y);
|
||||
expect((await page.locator('.consultation-composer').boundingBox())!.y - hintBounds.y - hintBounds.height).toBe(8);
|
||||
await page.getByTestId('teacher-chat-panel').screenshot({ path: test.info().outputPath(`composer-hint-${width}.png`) });
|
||||
expect(await sent()).toEqual([]);
|
||||
await input.fill('我想先自己说说');
|
||||
|
||||
Reference in New Issue
Block a user