Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

fix: updating the oas package to pull in some fixes for handling response schemas #461

Merged
merged 1 commit into from
Jan 28, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 0 additions & 28 deletions packages/api-explorer/__tests__/ResponseSchemaBody.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ const { shallow, mount } = require('enzyme');
const Oas = require('oas');

const ResponseSchemaBody = require('../src/ResponseSchemaBody');
const { flattenResponseSchema } = require('../src/ResponseSchemaBody');
const { flatten } = require('../src/ResponseSchemaBody');
const petstore = require('./fixtures/petstore/oas.json');

const oas = new Oas(petstore);
Expand Down Expand Up @@ -42,27 +40,6 @@ test('display properties if object contains $ref type', () => {
).toHaveLength(1);
});

test('should flatten schema to an array', () => {
const responseSchema = {
type: 'object',
properties: {
category: {
type: 'array',
items: {
type: 'string',
},
},
},
};
expect(flattenResponseSchema(responseSchema)).toStrictEqual([
{
name: 'category',
type: '[String]',
description: undefined,
},
]);
});

test('display object properties inside another object in the table', () => {
const schema = {
type: 'object',
Expand Down Expand Up @@ -308,8 +285,3 @@ test('should show "array" response schema type', () => {
.text(),
).toBe('Response schema type: array of objects');
});

test('should flatten array', () => {
const array = [[1], [2, 3], [[4, 5]]];
expect(flatten(array)).toStrictEqual([1, 2, 3, 4, 5]);
});