Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Chromatic Tests #3300

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions web/tests/e2e/admin_auth.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { TEST_CREDENTIALS } from "./constants";
setup("authenticate", async ({ page }) => {
const { email, password } = TEST_CREDENTIALS;

await page.goto("http://localhost:3000/search");
await page.goto("http://localhost:3000/chat");

await page.waitForURL("http://localhost:3000/auth/login?next=%2Fsearch");
await page.waitForURL("http://localhost:3000/auth/login?next=%2Fchat");

await expect(page).toHaveTitle("Danswer");

Expand All @@ -18,7 +18,7 @@ setup("authenticate", async ({ page }) => {
// Click the login button
await page.click('button[type="submit"]');

await page.waitForURL("http://localhost:3000/search");
await page.waitForURL("http://localhost:3000/chat");

await page.context().storageState({ path: "admin_auth.json" });
});
22 changes: 15 additions & 7 deletions web/tests/e2e/chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@ test(
async ({ page }, testInfo) => {
// Test simple loading
await page.goto("http://localhost:3000/chat");
await expect(page.locator("div.text-2xl").nth(0)).toHaveText("General");
await expect(page.getByRole("button", { name: "Search S" })).toHaveClass(
/text-text-application-untoggled/
);
await expect(page.getByRole("button", { name: "Chat D" })).toHaveClass(
/text-text-application-toggled/
);

// Check for the "General" text in the new UI element
await expect(
page.locator("div.flex.items-center span.font-bold")
).toHaveText("General");

// Check for the presence of the new UI element
await expect(
page.locator("div.flex.justify-center div.bg-black.rounded-full")
).toBeVisible();

// Check for the SVG icon
await expect(
page.locator("div.flex.justify-center svg.w-5.h-5")
).toBeVisible();
}
);
6 changes: 3 additions & 3 deletions web/tests/e2e/home.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ test(
// Test redirect to login, and redirect to search after login
const { email, password } = TEST_CREDENTIALS;

await page.goto("http://localhost:3000/search");
await page.goto("http://localhost:3000/chat");

await page.waitForURL("http://localhost:3000/auth/login?next=%2Fsearch");
await page.waitForURL("http://localhost:3000/auth/login?next=%2Fchat");

await expect(page).toHaveTitle("Danswer");

Expand All @@ -26,6 +26,6 @@ test(
// Click the login button
await page.click('button[type="submit"]');

await page.waitForURL("http://localhost:3000/search");
await page.waitForURL("http://localhost:3000/chat");
}
);
19 changes: 0 additions & 19 deletions web/tests/e2e/search.spec.ts

This file was deleted.

Loading