Bump papaparse from 4.6.3 to 5.2.0 in /packages/insomnia-app (#2590)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Opender Singh <opender.singh@konghq.com>
This commit is contained in:
dependabot[bot] 2020-09-18 06:05:53 +12:00 committed by GitHub
parent 0451ca4631
commit 3314c23ecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 153 additions and 198 deletions

View File

@ -14319,9 +14319,9 @@
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
},
"papaparse": {
"version": "4.6.3",
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-4.6.3.tgz",
"integrity": "sha512-LRq7BrHC2kHPBYSD50aKuw/B/dGcg29omyJbKWY3KsYUZU69RKwaBHu13jGmCYBtOc4odsLCrFyk6imfyNubJQ=="
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.2.0.tgz",
"integrity": "sha512-ylq1wgUSnagU+MKQtNeVqrPhZuMYBvOSL00DHycFTCxownF95gpLAk1HiHdUW77N8yxRq1qHXLdlIPyBSG9NSA=="
},
"parallel-transform": {
"version": "1.2.0",

View File

@ -151,7 +151,7 @@
"nunjucks": "^3.2.0",
"oauth-1.0a": "^2.2.2",
"openapi-2-kong": "^2.2.22",
"papaparse": "^4.3.6",
"papaparse": "^5.2.0",
"pdfjs-dist": "^2.2.228",
"prop-types": "^15.6.1",
"react": "^16.8.6",

View File

@ -50,28 +50,8 @@ describe('Application launch', function() {
it('creates and sends a request', async () => {
await debug.workspaceDropdownExists(app);
// Create a new request
await app.client.$('.sidebar .dropdown .fa-plus-circle').then(e => e.click());
await app.client
.$('[aria-hidden=false]')
.then(e => e.$('button*=New Request'))
.then(e => e.click());
// Wait for modal to open
await app.client.waitUntilTextExists('.modal__header', 'New Request');
// Set name and create request
const input = await app.client.$('.modal input');
await input.waitUntil(() => input.isFocused());
const requestName = 'Request from test';
await input.keys(requestName);
await app.client
.$('.modal .modal__footer')
.then(e => e.$('button=Create'))
.then(e => e.click());
await debug.createNewRequest(app, requestName);
// Ensure first item is the one we created and is selected
const requests = await app.client.$$('.sidebar__item');
@ -82,22 +62,20 @@ describe('Application launch', function() {
expect(firstRequestName).toBe(requestName);
expect(firstRequestClasses).toContain('sidebar__item--active');
// Type into url bar
const urlEditor = await app.client.$('.urlbar .editor');
await urlEditor.click();
await urlEditor.keys('http://127.0.0.1:4010/pets/1');
await debug.typeUrl(app, 'http://127.0.0.1:4010/pets/1');
await debug.clickSendRequest(app);
// Send request
await app.client.$('.urlbar__send-btn').then(e => e.click());
await debug.expect200(app);
});
// Expect 200
await app.client
.$('.response-pane .pane__header .tag.bg-success')
.then(e => e.getText())
.then(e => expect(e).toBe('200 OK'));
it('sends CSV request and shows rich response', async () => {
await debug.workspaceDropdownExists(app);
await debug.createNewRequest(app);
await debug.typeUrl(app, 'http://127.0.0.1:4010/csv');
await debug.clickSendRequest(app);
// await app.browserWindow.capturePage().then(function(imageBuffer) {
// fs.writeFileSync('page.png', imageBuffer);
// });
await debug.expect200(app);
const csvViewer = await debug.getCsvViewer(app);
await expect(csvViewer.getText()).resolves.toBe('a b c\n1 2 3');
});
});

View File

@ -2,6 +2,64 @@ const workspaceDropdownExists = async (app, workspaceName = 'Insomnia') => {
await app.client.waitUntilTextExists('.workspace-dropdown', workspaceName);
};
const createNewRequest = async (app, name = undefined) => {
await app.client.$('.sidebar .dropdown .fa-plus-circle').then(e => e.click());
await app.client
.$('[aria-hidden=false]')
.then(e => e.$('button*=New Request'))
.then(e => e.click());
// Wait for modal to open
await app.client.waitUntilTextExists('.modal__header', 'New Request');
// Set name and create request
const input = await app.client.$('.modal input');
if (name) {
await input.waitUntil(() => input.isFocused());
await input.keys(name);
}
await app.client
.$('.modal .modal__footer')
.then(e => e.$('button=Create'))
.then(e => e.click());
};
const typeUrl = async (app, url) => {
const urlEditor = await app.client.$('.urlbar .editor .input');
await typeCodeMirror(urlEditor, url);
};
const typeCodeMirror = async (element, value) => {
await element.click();
const cm = await element.$('.CodeMirror');
await cm.waitForExist();
await cm.keys(value);
};
const clickSendRequest = async app => {
await app.client.$('.urlbar__send-btn').then(e => e.click());
};
const expect200 = async app => {
const tag = await app.client.$('.response-pane .pane__header .tag.bg-success');
await tag.waitForDisplayed();
await expect(tag.getText()).resolves.toBe('200 OK');
};
const getCsvViewer = async app => {
const csvViewer = await app.client.react$('ResponseCSVViewer');
await csvViewer.waitForDisplayed();
return csvViewer;
};
module.exports = {
workspaceDropdownExists,
createNewRequest,
typeUrl,
clickSendRequest,
expect200,
getCsvViewer,
};

View File

@ -7,7 +7,7 @@
"spectron:designer:build": "xvfb-maybe jest --testPathPattern designer",
"spectron:core:package": "xvfb-maybe jest --testPathPattern core",
"spectron:designer:package": "xvfb-maybe jest --testPathPattern designer",
"start:prism": "prism mock prism/petstore.oas3.yaml",
"start:prism": "prism mock prism/oas3.yaml",
"with-mock": "concurrently --names prism,spectron --success first --kill-others \"npm run start:prism\"",
"test:core:build": "npm run with-mock \"npm run spectron:core:build\"",
"test:designer:build": "npm run with-mock \"npm run spectron:designer:build\"",

View File

@ -0,0 +1,77 @@
openapi: "3.0.0"
info:
version: 1.0.0
title: E2E testing specification
description: This is a specification used for E2E testing of Insomnia, and is served via prism
servers:
- url: http://127.0.0.1:4010
paths:
/pets/{id}:
get:
description: Returns a user based on a single ID, if the user does not have access to the pet
operationId: find pet by id
parameters:
- name: id
in: path
description: ID of pet to fetch
required: true
schema:
type: integer
format: int64
responses:
'200':
description: pet response
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/csv:
get:
description: Returns CSV content
responses:
200:
description: Get Todo Items
content:
text/csv:
schema: {}
example: |
a,b,c
1,2,3
components:
schemas:
Pet:
allOf:
- $ref: '#/components/schemas/NewPet'
- type: object
required:
- id
properties:
id:
type: integer
format: int64
NewPet:
type: object
required:
- name
properties:
name:
type: string
tag:
type: string
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string

View File

@ -1,158 +0,0 @@
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
description: A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification
termsOfService: http://swagger.io/terms/
contact:
name: Swagger API Team
email: apiteam@swagger.io
url: http://swagger.io
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: http://petstore.swagger.io/api
paths:
/pets:
get:
description: |
Returns all pets from the system that the user has access to
Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.
Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.
operationId: findPets
parameters:
- name: tags
in: query
description: tags to filter by
required: false
style: form
schema:
type: array
items:
type: string
- name: limit
in: query
description: maximum number of results to return
required: false
schema:
type: integer
format: int32
responses:
'200':
description: pet response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
post:
description: Creates a new pet in the store. Duplicates are allowed
operationId: addPet
requestBody:
description: Pet to add to the store
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/NewPet'
responses:
'200':
description: pet response
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/pets/{id}:
get:
description: Returns a user based on a single ID, if the user does not have access to the pet
operationId: find pet by id
parameters:
- name: id
in: path
description: ID of pet to fetch
required: true
schema:
type: integer
format: int64
responses:
'200':
description: pet response
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
description: deletes a single pet based on the ID supplied
operationId: deletePet
parameters:
- name: id
in: path
description: ID of pet to delete
required: true
schema:
type: integer
format: int64
responses:
'204':
description: pet deleted
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
Pet:
allOf:
- $ref: '#/components/schemas/NewPet'
- type: object
required:
- id
properties:
id:
type: integer
format: int64
NewPet:
type: object
required:
- name
properties:
name:
type: string
tag:
type: string
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string