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

test: Update metabase tests for latest vitest version #4223

Merged
merged 1 commit into from
Jan 28, 2025
Merged
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
test: Update metabase tests for latest vitest version
DafyddLlyr committed Jan 28, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d47491ba956bceaceb7758a54c6a5e6f19351b4a
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ import { createCollection } from "./createCollection.js";
describe("createTeamCollection", () => {
beforeEach(() => {
nock.cleanAll();
vi.resetAllMocks();
});

test("creates new collection when metabase ID doesn't exist", async () => {

Unchanged files with check annotations Beta

if (template === "save")
returnValue.expiryDate = config.personalisation.expiryDate;
return returnValue;
} catch (error: any) {

Check warning on line 73 in api.planx.uk/lib/notify/index.ts

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
const notifyError = error?.response?.data?.errors?.length
? JSON.stringify(error?.response?.data?.errors?.[0])
: error?.message;
return done({
status: 404,
message: `User (${email}) not found. Do you need to log in to a different Google Account?`,
} as any);

Check warning on line 20 in api.planx.uk/modules/auth/strategy/google.ts

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
}
done(null, { jwt });
import { Router } from "express";
import multer from "multer";

Check warning on line 3 in api.planx.uk/modules/file/routes.ts

GitHub Actions / Run API Tests

'multer' is defined but never used. Allowed unused vars must match /^_/u
import {
useNoCache,
useFilePermission,
const uploadAndLabelFileTypes = uploadAndLabelNodes
.map(([_nodeId, node]: [string, Node]) => node.data?.fileTypes)
.flat();
return uploadAndLabelFileTypes?.map((file: any) => file?.fn as string);

Check warning on line 70 in api.planx.uk/modules/flows/validate/service/fileTypes.ts

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
};
export { validateFileTypes };
fn: PASSPORT_FN,
value: true,
text: `is on a Classified Road`,
data: features.map((feature: any) => ({

Check warning on line 129 in api.planx.uk/modules/gis/service/classifiedRoads.ts

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
name: `${feature.properties["RoadName1"]} - ${feature.properties["RoadClassification"]}`,
entity: feature.properties["GmlID"], // match Planning Data "entity" identifier for convenience when reporting inaccurate constraints
properties: feature.properties,
},
} as GISResponse);
}
} catch (error: any) {

Check warning on line 151 in api.planx.uk/modules/gis/service/classifiedRoads.ts

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
return next({
message: "Failed to fetch classified roads: " + error?.message,
});
options,
)}${datasets}`;
const res = await fetch(url)
.then((response: { json: () => any }) => response.json())

Check warning on line 115 in api.planx.uk/modules/gis/service/digitalLand.ts

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
.catch((error: any) => console.log(error));

Check warning on line 116 in api.planx.uk/modules/gis/service/digitalLand.ts

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
// if analytics are "on", store an audit record of the raw response
if (extras?.analytics !== "false") {
// check for & add any 'positive' constraints to the formattedResult
let formattedResult: Record<string, Constraint> = {};
if (res && res.count > 0 && res.entities) {
res.entities.forEach((entity: { dataset: any }) => {

Check warning on line 150 in api.planx.uk/modules/gis/service/digitalLand.ts

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
// get the planx variable that corresponds to this entity's 'dataset', should never be null because our initial request is filtered on 'dataset'
const key = Object.keys(baseSchema).find((key) =>
baseSchema[key]["digital-land-datasets"]?.includes(entity.dataset),
formattedResult["designated.nationalPark"] &&
formattedResult["designated.nationalPark"].value
) {
formattedResult["designated.nationalPark"]?.data?.forEach((entity: any) => {

Check warning on line 199 in api.planx.uk/modules/gis/service/digitalLand.ts

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
if (
baseSchema[broads]["digital-land-entities"]?.includes(entity.entity)
) {
await page.getByText("Continue").click();
await page.getByLabel("email").fill(context.user.email);
await page.getByText("Continue").click();
await page.waitForLoadState("networkidle");

Check warning on line 97 in e2e/tests/ui-driven/src/invite-to-pay/agent.spec.ts

GitHub Actions / E2E tests

Unexpected use of networkidle
await expect(toggleInviteToPayButton).toBeDisabled();
});
context.flow?.slug
}/pay?analytics=false&paymentRequestId=INVALID-ID`;
await page.goto(invalidPaymentRequestURL);
await page.waitForLoadState("networkidle");

Check warning on line 98 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

GitHub Actions / E2E tests

Unexpected use of networkidle
await expect(page.getByText(PAYMENT_NOT_FOUND_TEXT)).toBeVisible();
});
test("navigating to a URL without a paymentRequestId", async ({ page }) => {
const invalidPaymentRequestURL = `/${context.team!.slug!}/${context.flow?.slug}/pay?analytics=false`;
await page.goto(invalidPaymentRequestURL);
await page.waitForLoadState("networkidle");

Check warning on line 106 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

GitHub Actions / E2E tests

Unexpected use of networkidle
await expect(page.getByText(PAYMENT_NOT_FOUND_TEXT)).toBeVisible();
});
) {
const paymentRequestURL = `/${context.team!.slug!}/${context.flow?.slug}/pay?analytics=false&paymentRequestId=${paymentRequest.id}`;
await page.goto(paymentRequestURL);
await page.waitForLoadState("networkidle");

Check warning on line 140 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

GitHub Actions / E2E tests

Unexpected use of networkidle
}
async function setupPaymentRequest(