diff --git a/ThePhasesOfCraftship/2_best_practice_first/advancedTesting/assignment/begin/tsconfig.json b/ThePhasesOfCraftship/2_best_practice_first/advancedTesting/assignment/begin/tsconfig.json index d7177b288..3342f2c13 100644 --- a/ThePhasesOfCraftship/2_best_practice_first/advancedTesting/assignment/begin/tsconfig.json +++ b/ThePhasesOfCraftship/2_best_practice_first/advancedTesting/assignment/begin/tsconfig.json @@ -6,7 +6,7 @@ "lib": ["es6"], "strict": true, "esModuleInterop": true, - "types": ["node", "jest"], + "types": ["node"], "resolveJsonModule": true, "paths": { "@dddforum/backend/*": ["./packages/backend/*"], diff --git a/ThePhasesOfCraftship/2_best_practice_first/advancedTesting/assignment/end/tsconfig.json b/ThePhasesOfCraftship/2_best_practice_first/advancedTesting/assignment/end/tsconfig.json index d7177b288..3342f2c13 100644 --- a/ThePhasesOfCraftship/2_best_practice_first/advancedTesting/assignment/end/tsconfig.json +++ b/ThePhasesOfCraftship/2_best_practice_first/advancedTesting/assignment/end/tsconfig.json @@ -6,7 +6,7 @@ "lib": ["es6"], "strict": true, "esModuleInterop": true, - "types": ["node", "jest"], + "types": ["node"], "resolveJsonModule": true, "paths": { "@dddforum/backend/*": ["./packages/backend/*"], diff --git a/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/begin/tsconfig.json b/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/begin/tsconfig.json index d7177b288..3342f2c13 100644 --- a/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/begin/tsconfig.json +++ b/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/begin/tsconfig.json @@ -6,7 +6,7 @@ "lib": ["es6"], "strict": true, "esModuleInterop": true, - "types": ["node", "jest"], + "types": ["node"], "resolveJsonModule": true, "paths": { "@dddforum/backend/*": ["./packages/backend/*"], diff --git a/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/frontend/tests/features/registration.e2e.ts b/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/frontend/tests/features/registration.e2e.ts index 1e1c16bbf..d12cc64f3 100644 --- a/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/frontend/tests/features/registration.e2e.ts +++ b/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/frontend/tests/features/registration.e2e.ts @@ -1,7 +1,7 @@ import { defineFeature, loadFeature } from 'jest-cucumber'; import { sharedTestRoot } from '@dddforum/shared/src/paths'; -import { CreateUserBuilder } from "@dddforum/shared/tests/support/builders/createUserBuilder"; +import { UserBuilder } from "@dddforum/shared/tests/support/builders/users"; import { CreateUserParams } from "@dddforum/shared/src/api/users"; import { Pages } from '../support/pages/pages'; @@ -50,7 +50,8 @@ defineFeature(feature, (test) => { test('Successful registration with marketing emails accepted', ({ given, when, then, and }) => { given('I am a new user', async () => { - user = new CreateUserBuilder() + user = new UserBuilder() + .makeCreateUserCommandBuilder() .withAllRandomDetails() .build(); @@ -75,7 +76,8 @@ defineFeature(feature, (test) => { test('Invalid or missing registration details', ({ given, when, then, and }) => { given('I am a new user', async () => { - user = new CreateUserBuilder() + user = new UserBuilder() + .makeCreateUserCommandBuilder() .withAllRandomDetails() .withEmail('skj') .build(); @@ -102,7 +104,8 @@ defineFeature(feature, (test) => { test('Account already created with email', ({ given, when, then, and }) => { given('a set of users already created accounts', async (table: CreateUserParams[]) => { users = table.map((user) => { - return new CreateUserBuilder() + return new UserBuilder() + .makeCreateUserCommandBuilder() .withAllRandomDetails() .withEmail(user.email) .withFirstName(user.firstName) diff --git a/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/frontend/tests/support/components/headerComponent.ts b/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/frontend/tests/support/components/headerComponent.ts index 64cd0146d..f9dcb2b5a 100644 --- a/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/frontend/tests/support/components/headerComponent.ts +++ b/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/frontend/tests/support/components/headerComponent.ts @@ -14,8 +14,8 @@ export class HeaderComponent extends Component { } async getUsernameFromHeader () { - const usernameElement = await this.elements.get('header'); - return usernameElement?.evaluate((e) => e.textContent); + const usernameElement = await this.elements.get('header') as any; + return usernameElement?.evaluate((e: any) => e.textContent); } } diff --git a/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/shared/src/utils/textUtil.ts b/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/shared/src/utils/textUtil.ts index 20ffb93cf..6f7d14b5d 100644 --- a/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/shared/src/utils/textUtil.ts +++ b/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/packages/shared/src/utils/textUtil.ts @@ -16,4 +16,8 @@ export class TextUtil { const randomSequence = Math.floor(Math.random() * 1000000); return `testemail-${randomSequence}@gmail.com`; } + + public static isBetweenLength(text: string, minLength: number, maxLength: number): boolean { + return text.length >= minLength && text.length <= maxLength; + } } diff --git a/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/tsconfig.json b/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/tsconfig.json index d7177b288..3342f2c13 100644 --- a/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/tsconfig.json +++ b/ThePhasesOfCraftship/2_best_practice_first/deployment/assignment/end/tsconfig.json @@ -6,7 +6,7 @@ "lib": ["es6"], "strict": true, "esModuleInterop": true, - "types": ["node", "jest"], + "types": ["node"], "resolveJsonModule": true, "paths": { "@dddforum/backend/*": ["./packages/backend/*"], diff --git a/ThePhasesOfCraftship/2_best_practice_first/strategicDesignPart3/assignment/end/tsconfig.json b/ThePhasesOfCraftship/2_best_practice_first/strategicDesignPart3/assignment/end/tsconfig.json index d7177b288..3342f2c13 100644 --- a/ThePhasesOfCraftship/2_best_practice_first/strategicDesignPart3/assignment/end/tsconfig.json +++ b/ThePhasesOfCraftship/2_best_practice_first/strategicDesignPart3/assignment/end/tsconfig.json @@ -6,7 +6,7 @@ "lib": ["es6"], "strict": true, "esModuleInterop": true, - "types": ["node", "jest"], + "types": ["node"], "resolveJsonModule": true, "paths": { "@dddforum/backend/*": ["./packages/backend/*"], diff --git a/ThePhasesOfCraftship/2_best_practice_first/uiToDB/assignment/begin/tsconfig.json b/ThePhasesOfCraftship/2_best_practice_first/uiToDB/assignment/begin/tsconfig.json index d7177b288..3342f2c13 100644 --- a/ThePhasesOfCraftship/2_best_practice_first/uiToDB/assignment/begin/tsconfig.json +++ b/ThePhasesOfCraftship/2_best_practice_first/uiToDB/assignment/begin/tsconfig.json @@ -6,7 +6,7 @@ "lib": ["es6"], "strict": true, "esModuleInterop": true, - "types": ["node", "jest"], + "types": ["node"], "resolveJsonModule": true, "paths": { "@dddforum/backend/*": ["./packages/backend/*"], diff --git a/ThePhasesOfCraftship/2_best_practice_first/uiToDB/assignment/end/tsconfig.json b/ThePhasesOfCraftship/2_best_practice_first/uiToDB/assignment/end/tsconfig.json index d7177b288..3342f2c13 100644 --- a/ThePhasesOfCraftship/2_best_practice_first/uiToDB/assignment/end/tsconfig.json +++ b/ThePhasesOfCraftship/2_best_practice_first/uiToDB/assignment/end/tsconfig.json @@ -6,7 +6,7 @@ "lib": ["es6"], "strict": true, "esModuleInterop": true, - "types": ["node", "jest"], + "types": ["node"], "resolveJsonModule": true, "paths": { "@dddforum/backend/*": ["./packages/backend/*"],