ui: match Agents entry artwork to module cards
This commit is contained in:
@@ -89,6 +89,11 @@ test.describe('Makelore module navigation without setup flow', () => {
|
||||
await expect(page.getByTestId('ai-module-selection-page')).toBeVisible();
|
||||
|
||||
const moduleCards = page.locator('[data-testid^="ai-module-option-"]');
|
||||
await expect(moduleCards.locator('img')).toHaveCount(4);
|
||||
await expect.poll(async () => await moduleCards.locator('img').evaluateAll((images) =>
|
||||
images.every((image) => image.complete && image.naturalWidth > 0),
|
||||
)).toBe(true);
|
||||
await page.screenshot({ path: test.info().outputPath('module-entry-artwork.png') });
|
||||
const readCardMetrics = async () => await moduleCards.evaluateAll((elements) => elements.map((element) => {
|
||||
const bounds = element.getBoundingClientRect();
|
||||
const image = element.querySelector('.module-option-card-image')?.getBoundingClientRect();
|
||||
|
||||
@@ -90,6 +90,8 @@ describe('AI module navigation', () => {
|
||||
expect(robotOption).toHaveTextContent('Robot 机器');
|
||||
expect(robotOption).toHaveTextContent('制作你的第一个机器人小伙伴');
|
||||
expect(screen.getByAltText('青少年管理机器人硬件与设备绑定')).toBeInTheDocument();
|
||||
expect(screen.getByAltText('个人云智能体')).toHaveAttribute('src', expect.stringContaining('module-agents.webp'));
|
||||
expect(screen.getByAltText('个人云智能体')).toHaveClass('module-option-card-image-media', 'object-cover');
|
||||
|
||||
fireEvent.click(screen.getByTestId('ai-module-option-painting'));
|
||||
expect(await screen.findByTestId('location-path')).toHaveTextContent('/image-canvas');
|
||||
|
||||
Reference in New Issue
Block a user