mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
refactor: improve test isolation for Axios API logic (#13125)
* wip: commit progress on code split-up * wip: commit more progress * wip: finish initial version of class implementation * chore: update all import paths to go through client instance * fix: remove temp comments * refactor: smoooooooosh the API * refactor: update import setup for tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { hasFirstUser } from "api/api";
|
||||
import { API } from "api/api";
|
||||
import { Language } from "pages/CreateUserPage/CreateUserForm";
|
||||
import { setupApiCalls } from "./api";
|
||||
import * as constants from "./constants";
|
||||
@@ -9,7 +9,7 @@ import { storageState } from "./playwright.config";
|
||||
test("setup deployment", async ({ page }) => {
|
||||
await page.goto("/", { waitUntil: "domcontentloaded" });
|
||||
await setupApiCalls(page);
|
||||
const exists = await hasFirstUser();
|
||||
const exists = await API.hasFirstUser();
|
||||
// First user already exists, abort early. All tests execute this as a dependency,
|
||||
// if you run multiple tests in the UI, this will fail unless we check this.
|
||||
if (exists) {
|
||||
|
||||
Reference in New Issue
Block a user