Skip to content

Commit

Permalink
Remove unneeded tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bravo-kernel committed Aug 23, 2019
1 parent 58f554c commit ea37120
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
18 changes: 0 additions & 18 deletions test/strategies/json-schema-v7-strategy.test.js
Expand Up @@ -21,22 +21,18 @@ describe('JsonSchema7Strategy', function() {
describe('Ensure schema.model:', function() {
const schemaUri = 'https://json-schema.org/draft-07/schema#';
it(`has property '$schema' with value '${schemaUri}'`, function() {
expect(schema).toHaveProperty('$schema');
expect(schema.$schema).toEqual('https://json-schema.org/draft-07/schema#');
});

it("has property '$id' with value '/user.json'", function() {
expect(schema).toHaveProperty('$id');
expect(schema.$id).toEqual('/user.json');
});

it("has property 'title' with value 'users'", function() {
expect(schema).toHaveProperty('title');
expect(schema.title).toEqual('User');
});

it("has property 'type' with value 'object'", function() {
expect(schema).toHaveProperty('type');
expect(schema.type).toEqual('object');
});
});
Expand All @@ -48,8 +44,6 @@ describe('JsonSchema7Strategy', function() {
if (supportedDataType('CITEXT')) {
describe('CITEXT', function() {
it("has property 'type' of type 'string'", function() {
expect(schema.properties).toHaveProperty('CITEXT');
expect(schema.properties.CITEXT).toHaveProperty('type');
expect(schema.properties.CITEXT.type).toEqual('string');
});
});
Expand All @@ -58,29 +52,22 @@ describe('JsonSchema7Strategy', function() {
if (supportedDataType('STRING')) {
describe('STRING', function() {
it("has property 'type' of type 'string'", function() {
expect(schema.properties).toHaveProperty('STRING');
expect(schema.properties.STRING).toHaveProperty('type');
expect(schema.properties.STRING.type).toEqual('string');
});
});

describe('STRING_1234', function() {
it("has property 'type' of type 'string'", function() {
expect(schema.properties).toHaveProperty('STRING_1234');
expect(schema.properties.STRING_1234).toHaveProperty('type');
expect(schema.properties.STRING_1234.type).toEqual('string');
});

it("has property 'maxLength' with value '1234'", function() {
expect(schema.properties.STRING_1234).toHaveProperty('maxLength');
expect(schema.properties.STRING_1234.maxLength).toEqual(1234);
});
});

describe('STRING_ALLOWNULL', function() {
it("has property 'type' of type 'array'", function() {
expect(schema.properties).toHaveProperty('STRING_ALLOWNULL');
expect(schema.properties.STRING_ALLOWNULL).toHaveProperty('type');
expect(Array.isArray(schema.properties.STRING_ALLOWNULL.type)).toBe(true);
});

Expand All @@ -96,8 +83,6 @@ describe('JsonSchema7Strategy', function() {
if (supportedDataType('TEXT')) {
describe('TEXT', function() {
it("has property 'type' of type 'string'", function() {
expect(schema.properties).toHaveProperty('TEXT');
expect(schema.properties.TEXT).toHaveProperty('type');
expect(schema.properties.TEXT.type).toEqual('string');
});
});
Expand All @@ -110,13 +95,10 @@ describe('JsonSchema7Strategy', function() {
describe('Ensure user-enriched Sequelized attributes are properly converted and thus:', function() {
describe('USER_ENRICHED_PROPERTIES', function() {
it("has property 'description' of type 'string'", function() {
expect(schema.properties).toHaveProperty('USER_ENRICHED_PROPERTIES');
expect(schema.properties.USER_ENRICHED_PROPERTIES).toHaveProperty('description');
expect(typeof schema.properties.USER_ENRICHED_PROPERTIES.description).toBe('string');
});

it("has property 'examples' of type 'array'", function() {
expect(schema.properties.USER_ENRICHED_PROPERTIES).toHaveProperty('examples');
expect(Array.isArray(schema.properties.USER_ENRICHED_PROPERTIES.examples)).toBe(true);
});
});
Expand Down
16 changes: 0 additions & 16 deletions test/strategies/openapi-v3-stragegy.test.js
Expand Up @@ -38,8 +38,6 @@ describe('OpenApi3Strategy', function() {
if (supportedDataType('CITEXT')) {
describe('CITEXT', function() {
it("has property 'type' of type 'string'", function() {
expect(userSchema.properties).toHaveProperty('CITEXT');
expect(userSchema.properties.CITEXT).toHaveProperty('type');
expect(userSchema.properties.CITEXT.type).toEqual('string');
});
});
Expand All @@ -48,29 +46,22 @@ describe('OpenApi3Strategy', function() {
if (supportedDataType('STRING')) {
describe('STRING', function() {
it("has property 'type' of type 'string'", function() {
expect(userSchema.properties).toHaveProperty('STRING');
expect(userSchema.properties.STRING).toHaveProperty('type');
expect(userSchema.properties.STRING.type).toEqual('string');
});
});

describe('STRING_1234', function() {
it("has property 'type' of type 'string'", function() {
expect(userSchema.properties).toHaveProperty('STRING_1234');
expect(userSchema.properties.STRING_1234).toHaveProperty('type');
expect(userSchema.properties.STRING_1234.type).toEqual('string');
});

it("has property 'maxLength' with value '1234'", function() {
expect(userSchema.properties.STRING_1234).toHaveProperty('maxLength');
expect(userSchema.properties.STRING_1234.maxLength).toEqual(1234);
});
});

describe('STRING_ALLOWNULL', function() {
it("has property 'type' of type 'string'", function() {
expect(userSchema.properties).toHaveProperty('STRING_ALLOWNULL');
expect(userSchema.properties.STRING_ALLOWNULL).toHaveProperty('type');
expect(userSchema.properties.STRING_ALLOWNULL.type).toEqual('string');
});

Expand All @@ -84,8 +75,6 @@ describe('OpenApi3Strategy', function() {
if (supportedDataType('TEXT')) {
describe('TEXT', function() {
it("has property 'type' of type 'string'", function() {
expect(userSchema.properties).toHaveProperty('TEXT');
expect(userSchema.properties.TEXT).toHaveProperty('type');
expect(userSchema.properties.TEXT.type).toEqual('string');
});
});
Expand All @@ -98,13 +87,10 @@ describe('OpenApi3Strategy', function() {
describe('Ensure user-enriched Sequelized attributes are properly converted and thus:', function() {
describe('USER_ENRICHED_PROPERTIES', function() {
it("has property 'description' of type 'string'", function() {
expect(userSchema.properties).toHaveProperty('USER_ENRICHED_PROPERTIES');
expect(userSchema.properties.USER_ENRICHED_PROPERTIES).toHaveProperty('description');
expect(typeof userSchema.properties.USER_ENRICHED_PROPERTIES.description).toBe('string');
});

it("has property 'example' of type 'array'", function() {
expect(userSchema.properties.USER_ENRICHED_PROPERTIES).toHaveProperty('example');
expect(Array.isArray(userSchema.properties.USER_ENRICHED_PROPERTIES.example)).toBe(true);
});
});
Expand All @@ -125,12 +111,10 @@ describe('OpenApi3Strategy', function() {
);

it("has leaf /openapi with string containing version '3.n.n'", function() {
expect(schemaWrapper).toHaveProperty('openapi');
expect(schemaWrapper.openapi).toMatch(/^3\.\d\.\d/); // 3.n.n
});

it('has non-empty container /components/schemas/users', function() {
expect(schemaWrapper.components.schemas).toHaveProperty('users');
expect(Object.keys(schemaWrapper.components.schemas.users).length).toBeGreaterThan(0);
});

Expand Down

0 comments on commit ea37120

Please sign in to comment.