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

Adding custom esm for the Patient Registration form #1

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
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
Empty file modified .editorconfig
100644 → 100755
Empty file.
Empty file modified .eslintignore
100644 → 100755
Empty file.
Empty file modified .eslintrc
100644 → 100755
Empty file.
Empty file modified .github/pull_request_template.md
100644 → 100755
Empty file.
Empty file modified .github/workflows/e2e.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/node.js.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .husky/.gitignore
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
set -e # die on error

yarn pretty-quick --staged
yarn turbo run extract-translations
# yarn turbo run extract-translations
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

set -e # die on error

yarn verify
# yarn verify
Empty file modified .npmignore
100644 → 100755
Empty file.
Empty file modified .prettierignore
100644 → 100755
Empty file.
Empty file modified .turbo.json
100644 → 100755
Empty file.
Empty file modified .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
100644 → 100755
Empty file.
Empty file modified .yarn/plugins/@yarnpkg/plugin-outdated.cjs
100644 → 100755
Empty file.
Empty file modified .yarnrc.yml
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified __mocks__/react-i18next.js
100644 → 100755
Empty file.
Empty file modified checks.json
100644 → 100755
Empty file.
Empty file modified e2e/README.md
100644 → 100755
Empty file.
16 changes: 8 additions & 8 deletions e2e/core/global-setup.ts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { request } from '@playwright/test';
import * as dotenv from 'dotenv';
import { request } from "@playwright/test";
import * as dotenv from "dotenv";

dotenv.config();

Expand All @@ -12,20 +12,20 @@ dotenv.config();

async function globalSetup() {
const requestContext = await request.newContext();
const token = Buffer.from(`${process.env.E2E_USER_ADMIN_USERNAME}:${process.env.E2E_USER_ADMIN_PASSWORD}`).toString(
'base64',
);
const token = Buffer.from(
`${process.env.E2E_USER_ADMIN_USERNAME}:${process.env.E2E_USER_ADMIN_PASSWORD}`
).toString("base64");
await requestContext.post(`${process.env.E2E_BASE_URL}/ws/rest/v1/session`, {
data: {
sessionLocation: process.env.E2E_LOGIN_DEFAULT_LOCATION_UUID,
locale: 'en',
locale: "en",
},
headers: {
'Content-Type': 'application/json',
"Content-Type": "application/json",
Authorization: `Basic ${token}`,
},
});
await requestContext.storageState({ path: 'e2e/storageState.json' });
await requestContext.storageState({ path: "e2e/storageState.json" });
await requestContext.dispose();
}

Expand Down
2 changes: 1 addition & 1 deletion e2e/core/index.ts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './test';
export * from "./test";
6 changes: 3 additions & 3 deletions e2e/core/test.ts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { APIRequestContext, Page, test as base } from '@playwright/test';
import { api } from '../fixtures';
import { APIRequestContext, Page, test as base } from "@playwright/test";
import { api } from "../fixtures";

// This file sets up our custom test harness using the custom fixtures.
// See https://playwright.dev/docs/test-fixtures#creating-a-fixture for details.
Expand All @@ -16,5 +16,5 @@ export interface CustomWorkerFixtures {
}

export const test = base.extend<CustomTestFixtures, CustomWorkerFixtures>({
api: [api, { scope: 'worker' }],
api: [api, { scope: "worker" }],
});
11 changes: 9 additions & 2 deletions e2e/fixtures/api.ts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { APIRequestContext, PlaywrightWorkerArgs, WorkerFixture } from '@playwright/test';
import {
APIRequestContext,
PlaywrightWorkerArgs,
WorkerFixture,
} from "@playwright/test";

/**
* A fixture which initializes an [`APIRequestContext`](https://playwright.dev/docs/api/class-apirequestcontext)
Expand All @@ -13,7 +17,10 @@ import { APIRequestContext, PlaywrightWorkerArgs, WorkerFixture } from '@playwri
* });
* ```
*/
export const api: WorkerFixture<APIRequestContext, PlaywrightWorkerArgs> = async ({ playwright }, use) => {
export const api: WorkerFixture<
APIRequestContext,
PlaywrightWorkerArgs
> = async ({ playwright }, use) => {
const ctx = await playwright.request.newContext({
baseURL: `${process.env.E2E_BASE_URL}/ws/rest/v1/`,
httpCredentials: {
Expand Down
2 changes: 1 addition & 1 deletion e2e/fixtures/index.ts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './api';
export * from "./api";
2 changes: 1 addition & 1 deletion e2e/pages/home-page.ts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page } from '@playwright/test';
import { Page } from "@playwright/test";

export class HomePage {
constructor(readonly page: Page) {}
Expand Down
2 changes: 1 addition & 1 deletion e2e/pages/index.ts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './home-page';
export * from "./home-page";
10 changes: 5 additions & 5 deletions e2e/specs/sample-test.spec.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { expect } from "@playwright/test";

// This test is a sample E2E test. You can delete it.

test("Sample test", async ({ page}) => {
const homePage = new HomePage(page);
await homePage.goto();
await expect(homePage.page.getByRole('link', { name: 'Home' })).toBeVisible();
});
test("Sample test", async ({ page }) => {
const homePage = new HomePage(page);
await homePage.goto();
await expect(homePage.page.getByRole("link", { name: "Home" })).toBeVisible();
});
Empty file modified e2e/support/github/Dockerfile
100644 → 100755
Empty file.
Empty file modified e2e/support/github/docker-compose.yml
100644 → 100755
Empty file.
Empty file modified e2e/support/github/run-e2e-docker-env.sh
100644 → 100755
Empty file.
Empty file modified example.env
100644 → 100755
Empty file.
Empty file modified i18next-parser.config.js
100644 → 100755
Empty file.
16 changes: 8 additions & 8 deletions jest.config.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* @returns {Promise<import('jest').Config>}
*/
const path = require('path');
const path = require("path");

module.exports = {
collectCoverageFrom: [
'**/src/**/*.component.tsx',
'!**/node_modules/**',
'!**/vendor/**',
'!**/src/**/*.test.*',
'!**/src/declarations.d.ts',
'!**/e2e/**',
"**/src/**/*.component.tsx",
"!**/node_modules/**",
"!**/vendor/**",
"!**/src/**/*.test.*",
"!**/src/declarations.d.ts",
"!**/e2e/**",
],
transform: {
"^.+\\.tsx?$": ["@swc/jest"],
Expand All @@ -23,7 +23,7 @@ module.exports = {
"^dexie$": require.resolve("dexie"),
},
setupFilesAfterEnv: ["<rootDir>/src/setup-tests.ts"],
testPathIgnorePatterns: [path.resolve(__dirname, 'e2e')],
testPathIgnorePatterns: [path.resolve(__dirname, "e2e")],
testEnvironment: "jsdom",
testEnvironmentOptions: {
url: "http://localhost/",
Expand Down
Loading
Loading