From 59965990372c9cd926332f1fa3762199138813c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Fri, 12 Jul 2024 18:33:22 +0100 Subject: [PATCH] test(e2e): Write to new team_settings table --- api.planx.uk/package.json | 2 +- api.planx.uk/pnpm-lock.yaml | 8 +++---- e2e/tests/api-driven/package.json | 2 +- e2e/tests/api-driven/pnpm-lock.yaml | 8 +++---- e2e/tests/api-driven/src/globalHelpers.ts | 6 +++-- e2e/tests/ui-driven/package.json | 2 +- e2e/tests/ui-driven/pnpm-lock.yaml | 8 +++---- e2e/tests/ui-driven/src/context.ts | 27 +++++++++++------------ editor.planx.uk/package.json | 2 +- editor.planx.uk/pnpm-lock.yaml | 10 ++++----- 10 files changed, 38 insertions(+), 37 deletions(-) diff --git a/api.planx.uk/package.json b/api.planx.uk/package.json index 64343791e3..4d5eb967bc 100644 --- a/api.planx.uk/package.json +++ b/api.planx.uk/package.json @@ -5,7 +5,7 @@ "packageManager": "pnpm@8.6.6", "dependencies": { "@airbrake/node": "^2.1.8", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#7666a78", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#f8d6480", "@types/isomorphic-fetch": "^0.0.36", "adm-zip": "^0.5.10", "aws-sdk": "^2.1467.0", diff --git a/api.planx.uk/pnpm-lock.yaml b/api.planx.uk/pnpm-lock.yaml index 956bcf7897..c4ce6e5aad 100644 --- a/api.planx.uk/pnpm-lock.yaml +++ b/api.planx.uk/pnpm-lock.yaml @@ -14,8 +14,8 @@ dependencies: specifier: ^2.1.8 version: 2.1.8 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#7666a78 - version: github.com/theopensystemslab/planx-core/7666a78 + specifier: git+https://github.com/theopensystemslab/planx-core#f8d6480 + version: github.com/theopensystemslab/planx-core/f8d6480 '@types/isomorphic-fetch': specifier: ^0.0.36 version: 0.0.36 @@ -8203,8 +8203,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/7666a78: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/7666a78} + github.com/theopensystemslab/planx-core/f8d6480: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/f8d6480} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/e2e/tests/api-driven/package.json b/e2e/tests/api-driven/package.json index 56327dd937..7f59584dca 100644 --- a/e2e/tests/api-driven/package.json +++ b/e2e/tests/api-driven/package.json @@ -7,7 +7,7 @@ "packageManager": "pnpm@8.6.6", "dependencies": { "@cucumber/cucumber": "^9.3.0", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#7666a78", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#f8d6480", "axios": "^1.6.8", "dotenv": "^16.3.1", "dotenv-expand": "^10.0.0", diff --git a/e2e/tests/api-driven/pnpm-lock.yaml b/e2e/tests/api-driven/pnpm-lock.yaml index bbf9d8c26e..dd487ecbba 100644 --- a/e2e/tests/api-driven/pnpm-lock.yaml +++ b/e2e/tests/api-driven/pnpm-lock.yaml @@ -9,8 +9,8 @@ dependencies: specifier: ^9.3.0 version: 9.3.0 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#7666a78 - version: github.com/theopensystemslab/planx-core/7666a78 + specifier: git+https://github.com/theopensystemslab/planx-core#f8d6480 + version: github.com/theopensystemslab/planx-core/f8d6480 axios: specifier: ^1.6.8 version: 1.6.8 @@ -3053,8 +3053,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/7666a78: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/7666a78} + github.com/theopensystemslab/planx-core/f8d6480: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/f8d6480} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/e2e/tests/api-driven/src/globalHelpers.ts b/e2e/tests/api-driven/src/globalHelpers.ts index e479549efe..159e8290ba 100644 --- a/e2e/tests/api-driven/src/globalHelpers.ts +++ b/e2e/tests/api-driven/src/globalHelpers.ts @@ -9,8 +9,10 @@ export function createTeam( name: "E2E Test Team", slug: "E2E", submissionEmail: TEST_EMAIL, - homepage: "planx.uk", - referenceCode: "ABCD", + settings: { + homepage: "http://www.planx.uk", + referenceCode: "ABCD", + }, ...args, }), ); diff --git a/e2e/tests/ui-driven/package.json b/e2e/tests/ui-driven/package.json index 0ec4fb8c07..ae79605c14 100644 --- a/e2e/tests/ui-driven/package.json +++ b/e2e/tests/ui-driven/package.json @@ -8,7 +8,7 @@ "postinstall": "./install-dependencies.sh" }, "dependencies": { - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#7666a78", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#f8d6480", "axios": "^1.6.8", "dotenv": "^16.3.1", "eslint": "^8.56.0", diff --git a/e2e/tests/ui-driven/pnpm-lock.yaml b/e2e/tests/ui-driven/pnpm-lock.yaml index 05082a1442..a6fcf0322a 100644 --- a/e2e/tests/ui-driven/pnpm-lock.yaml +++ b/e2e/tests/ui-driven/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#7666a78 - version: github.com/theopensystemslab/planx-core/7666a78 + specifier: git+https://github.com/theopensystemslab/planx-core#f8d6480 + version: github.com/theopensystemslab/planx-core/f8d6480 axios: specifier: ^1.6.8 version: 1.6.8 @@ -2782,8 +2782,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/7666a78: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/7666a78} + github.com/theopensystemslab/planx-core/f8d6480: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/f8d6480} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/e2e/tests/ui-driven/src/context.ts b/e2e/tests/ui-driven/src/context.ts index f2ccb89479..7f08ccf25f 100644 --- a/e2e/tests/ui-driven/src/context.ts +++ b/e2e/tests/ui-driven/src/context.ts @@ -4,6 +4,8 @@ import { sign } from "jsonwebtoken"; import { CoreDomainClient } from "@opensystemslab/planx-core"; import { GraphQLClient, gql } from "graphql-request"; +type NewTeam = Parameters[0]; + export interface Context { user: { id?: number; @@ -12,15 +14,7 @@ export interface Context { email: string; isPlatformAdmin: boolean; }; - team: { - id?: number; - name: string; - slug: string; - logo: string; - primaryColour: string; - homepage: string; - submissionEmail: string; - }; + team: { id?: number } & NewTeam; flow?: { id?: string; publishedId?: number; @@ -41,9 +35,13 @@ export const contextDefaults: Context = { team: { name: "E2E Test Team", slug: "E2E", - logo: "https://raw.githubusercontent.com/theopensystemslab/planx-team-logos/main/planx-testing.svg", - primaryColour: "#444444", - homepage: "planx.uk", + theme: { + logo: "https://raw.githubusercontent.com/theopensystemslab/planx-team-logos/main/planx-testing.svg", + primaryColour: "#444444", + }, + settings: { + homepage: "planx.uk", + }, submissionEmail: "simulate-delivered@notifications.service.gov.uk", }, }; @@ -60,9 +58,10 @@ export async function setUpTestContext( context.team.id = await $admin.team.create({ slug: context.team.slug, name: context.team.name, - homepage: context.team.homepage, submissionEmail: context.team.submissionEmail, - referenceCode: "ABCD", + settings: { + homepage: context.team.settings?.homepage, + }, }); } if ( diff --git a/editor.planx.uk/package.json b/editor.planx.uk/package.json index 74c80819f3..7649b19cc6 100644 --- a/editor.planx.uk/package.json +++ b/editor.planx.uk/package.json @@ -13,7 +13,7 @@ "@mui/material": "^5.15.2", "@mui/utils": "^5.15.2", "@opensystemslab/map": "^0.8.3", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#7666a78", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#f8d6480", "@tiptap/core": "^2.4.0", "@tiptap/extension-bold": "^2.0.3", "@tiptap/extension-bubble-menu": "^2.1.13", diff --git a/editor.planx.uk/pnpm-lock.yaml b/editor.planx.uk/pnpm-lock.yaml index d4765034e1..4d9b4eef14 100644 --- a/editor.planx.uk/pnpm-lock.yaml +++ b/editor.planx.uk/pnpm-lock.yaml @@ -43,8 +43,8 @@ dependencies: specifier: ^0.8.3 version: 0.8.3 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#7666a78 - version: github.com/theopensystemslab/planx-core/7666a78(@types/react@18.2.45) + specifier: git+https://github.com/theopensystemslab/planx-core#f8d6480 + version: github.com/theopensystemslab/planx-core/f8d6480(@types/react@18.2.45) '@tiptap/core': specifier: ^2.4.0 version: 2.4.0(@tiptap/pm@2.0.3) @@ -21832,9 +21832,9 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - github.com/theopensystemslab/planx-core/7666a78(@types/react@18.2.45): - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/7666a78} - id: github.com/theopensystemslab/planx-core/7666a78 + github.com/theopensystemslab/planx-core/f8d6480(@types/react@18.2.45): + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/f8d6480} + id: github.com/theopensystemslab/planx-core/f8d6480 name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true