Files
AFFiNE-Mirror/tests/affine-cloud-copilot/e2e/basic/authority.spec.ts
yoyoyohamapi c61df18ab9 test(core): chat with collection & tags (#11388)
### TL:DR

* AI chat with collection E2E
* AI chat with tag E2E

> Close BS-3007
2025-04-03 02:46:08 +00:00

29 lines
886 B
TypeScript

import { expect } from '@playwright/test';
import { test } from '../base/base-test';
test.describe('AIBasic/Authority', () => {
test.beforeEach(async ({ page, utils }) => {
await utils.testUtils.setupTestEnvironment(page, false);
await utils.chatPanel.openChatPanel(page);
});
test('should show error & login button when no login', async ({
page,
utils,
}) => {
await utils.chatPanel.makeChat(page, 'Hello');
await expect(page.getByTestId('ai-error')).toBeVisible();
await expect(page.getByTestId('ai-error-action-button')).toBeVisible();
});
test('should support login in error state', async ({ page, utils }) => {
await utils.chatPanel.makeChat(page, 'Hello');
const loginButton = page.getByTestId('ai-error-action-button');
await loginButton.click();
await expect(page.getByTestId('auth-modal')).toBeVisible();
});
});