Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Dec 15, 2024
1 parent 4f5a2b4 commit 7964358
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
11 changes: 11 additions & 0 deletions web/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ export default defineConfig({
},
dependencies: ["admin_setup"],
},
{
// tests core flows
name: "chromium-core-flows",
testMatch: /.*\/core_flows\/.*/,
use: {
...devices["Desktop Chrome"],
// Use prepared auth state.
storageState: "admin_auth.json",
},
dependencies: ["admin_setup"],
},
{
// tests logged out / guest workflows
name: "chromium-guest",
Expand Down
3 changes: 2 additions & 1 deletion web/src/app/admin/embeddings/pages/EmbeddingFormPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ export default function EmbeddingForm() {
<button
className="enabled:cursor-pointer ml-auto disabled:bg-accent/50 disabled:cursor-not-allowed bg-accent flex mx-auto gap-x-1 items-center text-white py-2.5 px-3.5 text-sm font-regular rounded-sm"
onClick={async () => {
updateSearch();
await updateSearch();
router.refresh();
navigateToEmbeddingPage("search settings");
}}
>
Expand Down
14 changes: 14 additions & 0 deletions web/tests/e2e/core_flows/search_update.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { test, expect } from "@playwright/test";

test("test", async ({ page }) => {
await page.goto("http://localhost:3000/admin/configuration/search");
await page.getByRole("button", { name: "Update Search Settings" }).click();
await page.getByRole("button", { name: "Continue" }).click();
await page.getByRole("button", { name: "Self-hosted" }).click();
await page.getByText("MixedBread XSmallFastest,").click();
await page.getByRole("button", { name: "Update Search" }).click();
await page.waitForSelector("text=mixedbread-ai/mxbai-rerank-xsmall-v1");
await expect(page.locator("body")).toContainText(
"mixedbread-ai/mxbai-rerank-xsmall-v1"
);
});

0 comments on commit 7964358

Please sign in to comment.