Skip to content

Commit

Permalink
Removed start server on record
Browse files Browse the repository at this point in the history
  • Loading branch information
MaPoKen committed Jun 26, 2024
1 parent 461524d commit f7f9c95
Show file tree
Hide file tree
Showing 45 changed files with 62 additions and 77 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions e2e/specs/unauthenticated/film_page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ test("film page has content", async ({ page }) => {
has: page.getByRole("heading", { name: "Emner i film:" }),
hasNot: page.locator("span", { hasText: "Sammen skaper vi framtidas læring" }),
});
await expect(subjects.getByRole("navigation").getByRole("list").getByRole("listitem")).toHaveCount(7);
await expect(subjects.getByRole("navigation").getByRole("list").getByRole("listitem")).toHaveCount(8);
const identitet = page.locator("div", {
has: page.getByRole("heading", { name: "Identitet" }),
hasNot: page.locator("span", { hasText: "Sammen skaper vi framtidas læring" }),
});
await expect(identitet.getByRole("listitem")).toHaveCount(7);
await expect(identitet.getByRole("listitem")).toHaveCount(8);
});
2 changes: 0 additions & 2 deletions e2e/specs/unauthenticated/topic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ test("show have functioning language box", async ({ page }) => {
.getByRole("link", { name: "Tverrfaglige medieoppdrag" })
.click();

await mockWaitResponse(page, "**/graphql-api/*");

await expect(page.getByRole("heading", { name: "Tverrfaglige medieoppdrag" })).toBeVisible();
await expect(page.getByRole("button", { name: "Vis hele emnebeskrivelsen" })).toBeVisible();
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@ndla/types-backend": "^0.2.84",
"@ndla/types-embed": "^4.1.7",
"@ndla/types-taxonomy": "^1.0.25",
"@playwright/test": "^1.43.1",
"@playwright/test": "^1.45.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.2",
"@types/express": "^4.17.21",
Expand Down
6 changes: 2 additions & 4 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
retries: 2,
reporter: "html",
workers: 1,
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:3000",
Expand Down Expand Up @@ -55,8 +56,5 @@ export default defineConfig({
command: "cross-env NODE_ENV=production node build/server.mjs",
port: 3000,
}
: {
command: `IS_E2E=true yarn start`,
url: "http://localhost:3000",
},
: undefined,
});
2 changes: 0 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ export type ConfigType = {
runtimeType: RuntimeType;
isClient: boolean;
folderRedesign: boolean;
isE2E: boolean;
};

const getServerSideConfig = (): ConfigType => {
Expand Down Expand Up @@ -149,7 +148,6 @@ const getServerSideConfig = (): ConfigType => {
runtimeType: getEnvironmentVariabel("NODE_ENV", "development") as RuntimeType,
isClient: false,
folderRedesign: getEnvironmentVariabel("FOLDER_REDESIGN", false),
isE2E: getEnvironmentVariabel("IS_E2E", false) || getEnvironmentVariabel("CI", false),
};
};

Expand Down
17 changes: 4 additions & 13 deletions src/util/apiHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
*
*/

import {
ApolloClient,
ApolloLink,
FieldFunctionOptions,
InMemoryCache,
TypePolicies,
createHttpLink,
} from "@apollo/client/core";
import { ApolloClient, ApolloLink, FieldFunctionOptions, InMemoryCache, TypePolicies } from "@apollo/client/core";
import { BatchHttpLink } from "@apollo/client/link/batch-http";
import { setContext } from "@apollo/client/link/context";
import { onError } from "@apollo/client/link/error";
Expand Down Expand Up @@ -244,11 +237,9 @@ export const createApolloLinks = (lang: string, versionHash?: string) => {
}
}),
headersLink,
!config.isE2E
? new BatchHttpLink({
uri,
})
: createHttpLink({ uri }),
new BatchHttpLink({
uri,
}),
]);
};

Expand Down
30 changes: 15 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3610,14 +3610,14 @@ __metadata:
languageName: node
linkType: hard

"@playwright/test@npm:^1.43.1":
version: 1.44.1
resolution: "@playwright/test@npm:1.44.1"
"@playwright/test@npm:^1.45.0":
version: 1.45.0
resolution: "@playwright/test@npm:1.45.0"
dependencies:
playwright: "npm:1.44.1"
playwright: "npm:1.45.0"
bin:
playwright: cli.js
checksum: 10c0/f72669db3dfa83dc12d43ddbce8fbb27a69a80347b515fa00d8467ca640f8c7b7f5f5ff6d6cdfc5a1bce2c7d4b6ee62b988d682ef265f567302998de4f2a64ab
checksum: 10c0/bfb3cdcca2df5ef7a2a380cc189a5ed905bef9551a2b84071c42b620b77e32a2cffdb74841957bb5e519559ed26b42a7777d09dc897a6aee67258cc041e705f9
languageName: node
linkType: hard

Expand Down Expand Up @@ -10937,7 +10937,7 @@ __metadata:
"@ndla/typography": "npm:^0.4.22"
"@ndla/ui": "npm:^54.0.2"
"@ndla/util": "npm:^4.0.4"
"@playwright/test": "npm:^1.43.1"
"@playwright/test": "npm:^1.45.0"
"@testing-library/jest-dom": "npm:^6.4.2"
"@testing-library/react": "npm:^15.0.2"
"@types/express": "npm:^4.17.21"
Expand Down Expand Up @@ -11739,27 +11739,27 @@ __metadata:
languageName: node
linkType: hard

"playwright-core@npm:1.44.1":
version: 1.44.1
resolution: "playwright-core@npm:1.44.1"
"playwright-core@npm:1.45.0":
version: 1.45.0
resolution: "playwright-core@npm:1.45.0"
bin:
playwright-core: cli.js
checksum: 10c0/6ffa3a04822b3df86d7f47a97e4f20318c0c50868ba4311820e6626ecadaab1424fbd0a3d01f0b4228adc0c781115e44b801742a4970b88739f804d82f142d68
checksum: 10c0/5c3c205ad6d52c674fb3a91981a2068b17e7d02350c868cb3bc51e0c236df1b5da7c123ebdb6c22c66c8182965d2bba0831fa272a8a388c4e545eac5b3efa501
languageName: node
linkType: hard

"playwright@npm:1.44.1":
version: 1.44.1
resolution: "playwright@npm:1.44.1"
"playwright@npm:1.45.0":
version: 1.45.0
resolution: "playwright@npm:1.45.0"
dependencies:
fsevents: "npm:2.3.2"
playwright-core: "npm:1.44.1"
playwright-core: "npm:1.45.0"
dependenciesMeta:
fsevents:
optional: true
bin:
playwright: cli.js
checksum: 10c0/de827d17746b18ae2ec67d510a640d8ceebf8ee8e3d8399bccffa83b76a967498ca377777e4e6a1daaef4b3c86cb2c44c7468de53d2d915acc61b3b89c032738
checksum: 10c0/dbb1c3fe127650bd4b96a84b5271fbb56eea298bc87fa43a16b5054a4f011e00edd9a1a5e769efe4776a7c60d2a87c280543930a19cd12846d3d1e266198d4df
languageName: node
linkType: hard

Expand Down

0 comments on commit f7f9c95

Please sign in to comment.