Skip to content

Commit

Permalink
Fixed some spec files
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshingYou1 committed Oct 2, 2023
1 parent 839c753 commit 87f36c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 5 additions & 4 deletions test/schemas/10-10EZ/schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { expect } from 'chai';
import { it } from 'mocha';
import schemas from '../../../dist/schemas';
import SchemaTestHelper from '../../support/schema-test-helper';
import definitions from '../../../src/common/definitions';

const applicationSchema = schemas['10-10EZ'];

Expand All @@ -15,7 +16,7 @@ function definitionValidator(field) {
$schema: 'http://json-schema.org/draft-04/schema#',
type: 'object',
properties: {
field: applicationSchema.definitions[field],
field: definitions[field],
},
};

Expand All @@ -34,7 +35,7 @@ function stringGenerate(length) {
// getting what's expected all around.
describe('healthcare-application json schema', () => {
describe('phone', () => {
const phoneValidation = definitionValidator('phone');
const phoneValidation = definitionValidator('hcaPhone');
it('validates a 10 digit number as a string', () => {
expect(phoneValidation('1234567890')).to.be.true;
});
Expand Down Expand Up @@ -68,7 +69,7 @@ describe('healthcare-application json schema', () => {
});

describe('fullName', () => {
const fullNameValidation = definitionValidator('fullName');
const fullNameValidation = definitionValidator('hcaFullName');
it('allows 2 letter last names', () => {
expect(fullNameValidation({ first: 'foo', last: 'ba' })).to.be.true;
});
Expand All @@ -83,7 +84,7 @@ describe('healthcare-application json schema', () => {
});

describe('address', () => {
const addressValidation = definitionValidator('address');
const addressValidation = definitionValidator('hcaAddress');
it("doesn't allow street, cities, or provinces with only spaces", () => {
expect(addressValidation({ street: ' ', city: ' ', country: ' ', provinceCode: ' ' })).to.be.false;
});
Expand Down
8 changes: 5 additions & 3 deletions test/schemas/10-10EZR/schema.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import ajv from 'ajv';
import { omit } from 'lodash';
import { expect } from 'chai';
import { it } from 'mocha';
import schemas from '../../../dist/schemas';
import SchemaTestHelper from '../../support/schema-test-helper';
import definitions from '../../../src/common/definitions';

const applicationSchema = schemas['10-10EZR'];

Expand All @@ -14,7 +16,7 @@ function definitionValidator(field) {
$schema: 'http://json-schema.org/draft-04/schema#',
type: 'object',
properties: {
field: applicationSchema.definitions[field],
field: definitions[field],
},
};

Expand All @@ -27,7 +29,7 @@ function definitionValidator(field) {

describe('1010ezr json schema', () => {
describe('phone', () => {
const phoneValidation = definitionValidator('phone');
const phoneValidation = definitionValidator('hcaPhone');
it('validates a 10 digit number as a string', () => {
expect(phoneValidation('1234567890')).to.be.true;
});
Expand Down Expand Up @@ -61,7 +63,7 @@ describe('1010ezr json schema', () => {
});

describe('address', () => {
const addressValidation = definitionValidator('address');
const addressValidation = definitionValidator('hcaAddress');
it("doesn't allow street, cities, or provinces with only spaces", () => {
expect(addressValidation({ street: ' ', city: ' ', country: ' ', provinceCode: ' ' })).to.be.false;
});
Expand Down

0 comments on commit 87f36c1

Please sign in to comment.