Skip to content

Commit 989dbec

Browse files
committed
Tests fixed
Signed-off-by: Sanjay Babu <sanjaytkbabu@gmail.com>
1 parent 8eb001f commit 989dbec

File tree

5 files changed

+8
-45
lines changed

5 files changed

+8
-45
lines changed

app/tests/unit/validators/basic.spec.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import { BasicResponse } from '../../../src/utils/enums/application';
21
import { ProjectApplicant } from '../../../src/utils/enums/housing';
32
import { basicIntake, basicEnquiry } from '../../../src/validators/basic';
43

54
describe('basicIntakeSchema', () => {
6-
it('should validate when projectApplicantType and isDevelopedInBc are valid', () => {
5+
it('should validate when projectApplicantType is valid', () => {
76
const data = {
87
projectApplicantType: ProjectApplicant.BUSINESS,
9-
isDevelopedInBc: BasicResponse.YES,
108
registeredName: 'My Company'
119
};
1210

@@ -17,43 +15,12 @@ describe('basicIntakeSchema', () => {
1715
it('should throw an error when projectApplicantType is invalid', () => {
1816
const data = {
1917
projectApplicantType: 'invalid',
20-
isDevelopedInBc: BasicResponse.YES,
2118
registeredName: 'My Company'
2219
};
2320

2421
const result = basicIntake.validate(data);
2522
expect(result.error).toBeDefined();
2623
});
27-
28-
it('should throw an error when isDevelopedInBc is invalid', () => {
29-
const data = {
30-
projectApplicantType: ProjectApplicant.BUSINESS,
31-
isDevelopedInBc: 'invalid'
32-
};
33-
34-
const result = basicIntake.validate(data);
35-
expect(result.error).toBeDefined();
36-
});
37-
38-
it('should throw an error when isDevelopedInBc is BUSINESS but registeredName is not provided', () => {
39-
const data = {
40-
projectApplicantType: ProjectApplicant.BUSINESS,
41-
isDevelopedInBc: BasicResponse.YES
42-
};
43-
44-
const result = basicIntake.validate(data);
45-
expect(result.error).toBeDefined();
46-
});
47-
48-
it('should throw an error when isDevelopedInBc is BUSINESS and registeredName is not provided', () => {
49-
const data = {
50-
projectApplicantType: ProjectApplicant.BUSINESS,
51-
isDevelopedInBc: BasicResponse.NO
52-
};
53-
54-
const result = basicIntake.validate(data);
55-
expect(result.error).toBeDefined();
56-
});
5724
});
5825

5926
function validEnquiryData() {

frontend/tests/unit/components/common/Breadcrumb.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ const testProject: HousingProject = {
5454
companyNameRegistered: 'Example Company',
5555
companyIdRegistered: 'FM0281610',
5656
consentToFeedback: true,
57-
isDevelopedInBc: 'Yes',
5857
projectName: 'Super Long Project Name',
5958
projectDescription: 'This is a test project description.',
6059
projectLocationDescription: 'Test location description.',

frontend/tests/unit/components/contact/ContactHistoryList.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ const testSubmission: HousingProject = {
4949
hasRelatedEnquiry: false,
5050
companyIdRegistered: 'FM0281610',
5151
companyNameRegistered: 'Company Inc.',
52-
isDevelopedInBc: 'Yes',
5352
projectName: 'Test Project',
5453
projectDescription: 'Test Description',
5554
projectLocationDescription: 'Location Description',

frontend/tests/unit/components/housing/project/ProjectForm.spec.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ const testSubmission: HousingProject = {
102102
companyIdRegistered: 'FM0281610',
103103
companyNameRegistered: 'Example Company',
104104
consentToFeedback: true,
105-
isDevelopedInBc: 'Yes',
106105
projectName: 'Project Alpha',
107106
projectDescription: 'This is a test project description.',
108107
projectLocationDescription: 'Test location description.',
@@ -313,7 +312,7 @@ describe('onRegisteredNameInput', () => {
313312
});
314313

315314
it('should not call searchOrgBook when query length is less than 2', async () => {
316-
const modifiedSubmission = { ...testSubmission, isDevelopedInBc: 'Yes' };
315+
const modifiedSubmission = { ...testSubmission };
317316
const wrapper = mount(ProjectForm, wrapperSettings(modifiedSubmission));
318317
await nextTick();
319318
await nextTick();
@@ -341,7 +340,7 @@ describe('onRegisteredNameInput', () => {
341340

342341
searchOrgBookSpy.mockResolvedValue(mockResponse as AxiosResponse);
343342

344-
const modifiedSubmission = { ...testSubmission, isDevelopedInBc: 'Yes' };
343+
const modifiedSubmission = { ...testSubmission };
345344
const wrapper = mount(ProjectForm, wrapperSettings(modifiedSubmission));
346345
await nextTick();
347346
await nextTick();
@@ -372,7 +371,7 @@ describe('onRegisteredNameInput', () => {
372371

373372
searchOrgBookSpy.mockResolvedValue(mockResponse as AxiosResponse);
374373

375-
const modifiedSubmission = { ...testSubmission, isDevelopedInBc: 'Yes' };
374+
const modifiedSubmission = { ...testSubmission };
376375
const wrapper = mount(ProjectForm, wrapperSettings(modifiedSubmission));
377376
await nextTick();
378377
await nextTick();
@@ -408,7 +407,7 @@ describe('onRegisteredNameInput', () => {
408407

409408
searchOrgBookSpy.mockResolvedValue(mockResponse as AxiosResponse);
410409

411-
const modifiedSubmission = { ...testSubmission, isDevelopedInBc: 'Yes' };
410+
const modifiedSubmission = { ...testSubmission };
412411
const wrapper = mount(ProjectForm, wrapperSettings(modifiedSubmission));
413412
await nextTick();
414413
await nextTick();
@@ -433,7 +432,7 @@ describe('onRegisteredNameInput', () => {
433432

434433
searchOrgBookSpy.mockResolvedValue(mockResponse as AxiosResponse);
435434

436-
const modifiedSubmission = { ...testSubmission, isDevelopedInBc: 'Yes' };
435+
const modifiedSubmission = { ...testSubmission };
437436
const wrapper = mount(ProjectForm, wrapperSettings(modifiedSubmission));
438437
await nextTick();
439438
await nextTick();
@@ -463,7 +462,7 @@ describe('onRegisteredNameInput', () => {
463462

464463
searchOrgBookSpy.mockResolvedValue(mockResponse as AxiosResponse);
465464

466-
const modifiedSubmission = { ...testSubmission, isDevelopedInBc: 'Yes' };
465+
const modifiedSubmission = { ...testSubmission };
467466
const wrapper = mount(ProjectForm, wrapperSettings(modifiedSubmission));
468467
await nextTick();
469468
await nextTick();
@@ -490,7 +489,7 @@ describe('onRegisteredNameInput', () => {
490489

491490
searchOrgBookSpy.mockResolvedValue(mockResponse as AxiosResponse);
492491

493-
const modifiedSubmission = { ...testSubmission, isDevelopedInBc: 'Yes' };
492+
const modifiedSubmission = { ...testSubmission };
494493
const wrapper = mount(ProjectForm, wrapperSettings(modifiedSubmission));
495494
await nextTick();
496495
await nextTick();

frontend/tests/unit/components/housing/submission/SubmissionListNavigator.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ const testSubmission: HousingProject = {
8383
companyIdRegistered: 'FM0281610',
8484
companyNameRegistered: 'Example Company',
8585
consentToFeedback: true,
86-
isDevelopedInBc: 'Yes',
8786
projectName: 'Project Alpha',
8887
projectDescription: 'This is a test project description.',
8988
projectLocationDescription: 'Test location description.',

0 commit comments

Comments
 (0)