Format
This commit is contained in:
@@ -109,10 +109,10 @@ test.describe("Allowed Domains Settings", () => {
|
||||
await expect(successMsg).toBeVisible({ timeout: 5000 });
|
||||
|
||||
// Clean up via API
|
||||
await fetch(
|
||||
`${baseUrl}/_emdash/api/admin/allowed-domains/${encodeURIComponent(testDomain)}`,
|
||||
{ method: "DELETE", headers },
|
||||
).catch(() => {});
|
||||
await fetch(`${baseUrl}/_emdash/api/admin/allowed-domains/${encodeURIComponent(testDomain)}`, {
|
||||
method: "DELETE",
|
||||
headers,
|
||||
}).catch(() => {});
|
||||
});
|
||||
|
||||
test("removes a domain via the UI", async ({ admin, page }) => {
|
||||
@@ -193,10 +193,10 @@ test.describe("Allowed Domains Settings", () => {
|
||||
await expect(page.locator(`.font-medium`, { hasText: testDomain })).toBeVisible();
|
||||
|
||||
// Clean up
|
||||
await fetch(
|
||||
`${baseUrl}/_emdash/api/admin/allowed-domains/${encodeURIComponent(testDomain)}`,
|
||||
{ method: "DELETE", headers },
|
||||
).catch(() => {});
|
||||
await fetch(`${baseUrl}/_emdash/api/admin/allowed-domains/${encodeURIComponent(testDomain)}`, {
|
||||
method: "DELETE",
|
||||
headers,
|
||||
}).catch(() => {});
|
||||
});
|
||||
|
||||
test("toggling enabled/disabled updates the domain", async ({ admin, page }) => {
|
||||
@@ -228,9 +228,9 @@ test.describe("Allowed Domains Settings", () => {
|
||||
await expect(statusMsg).toBeVisible({ timeout: 5000 });
|
||||
|
||||
// Clean up
|
||||
await fetch(
|
||||
`${baseUrl}/_emdash/api/admin/allowed-domains/${encodeURIComponent(testDomain)}`,
|
||||
{ method: "DELETE", headers },
|
||||
).catch(() => {});
|
||||
await fetch(`${baseUrl}/_emdash/api/admin/allowed-domains/${encodeURIComponent(testDomain)}`, {
|
||||
method: "DELETE",
|
||||
headers,
|
||||
}).catch(() => {});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -342,13 +342,10 @@ test.describe("Revisions", () => {
|
||||
const olderRevisionId = revisions[1].id;
|
||||
|
||||
// Restore via API
|
||||
const restoreRes = await fetch(
|
||||
`${baseUrl}/_emdash/api/revisions/${olderRevisionId}/restore`,
|
||||
{
|
||||
method: "POST",
|
||||
headers,
|
||||
},
|
||||
);
|
||||
const restoreRes = await fetch(`${baseUrl}/_emdash/api/revisions/${olderRevisionId}/restore`, {
|
||||
method: "POST",
|
||||
headers,
|
||||
});
|
||||
expect(restoreRes.status).toBe(200);
|
||||
|
||||
// Get revision count after restore -- should have increased
|
||||
|
||||
@@ -272,11 +272,7 @@ test.describe("Search", () => {
|
||||
// TODO: getSuggestions fails in dev mode -- needs investigation
|
||||
await enableSearch(serverInfo, "posts");
|
||||
|
||||
const res = await apiRequest(
|
||||
serverInfo,
|
||||
"GET",
|
||||
"/_emdash/api/search/suggest?q=Fir&limit=5",
|
||||
);
|
||||
const res = await apiRequest(serverInfo, "GET", "/_emdash/api/search/suggest?q=Fir&limit=5");
|
||||
expect(res.status).toBe(200);
|
||||
|
||||
const body = await res.json();
|
||||
|
||||
Reference in New Issue
Block a user