mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
Fix tests
This commit is contained in:
parent
33b126ee87
commit
94119f6b68
@ -10,7 +10,6 @@ import * as models from '../models/index';
|
||||
import AlertModal from '../ui/components/modals/alert-modal';
|
||||
import {showModal} from '../ui/components/modals/index';
|
||||
import {trackEvent} from '../analytics/index';
|
||||
import {workspace} from '../models/index';
|
||||
|
||||
export const CHANGE_INSERT = 'insert';
|
||||
export const CHANGE_UPDATE = 'update';
|
||||
@ -90,12 +89,6 @@ export async function init (types: Array<string>, config: Object = {}, forceRese
|
||||
db[modelType] = collection;
|
||||
}
|
||||
|
||||
// Make sure CookieJars and environments exist for all workspaces
|
||||
for (const workspace of await models.workspace.all()) {
|
||||
await models.cookieJar.getOrCreateForParentId(workspace._id);
|
||||
await models.environment.getOrCreateForWorkspace(workspace);
|
||||
}
|
||||
|
||||
console.log(`[db] Initialized DB at ${getDBFilePath('$TYPE')}`);
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,107 @@ const v4UUIDs = [
|
||||
'6d6e6070-c192-46dc-ae1a-4b819828fbae',
|
||||
'650345e6-73c5-49f1-92cc-b16f70dfabf0',
|
||||
'8d85d153-da68-4123-a3f8-03753be9c7e8',
|
||||
'185dc090-3fcc-44e3-8a17-4e2fa792f91a'
|
||||
'185dc090-3fcc-44e3-8a17-4e2fa792f91a',
|
||||
'f8e9aae9-1e6f-45c3-923a-74af73f4091e',
|
||||
'73415a9e-2f83-48c6-814a-7aed39e54247',
|
||||
'f2e38b71-2a4a-41e2-bc90-162b0e2cc64f',
|
||||
'f8db47d9-cfac-4fd9-8ed0-f510ff0005d0',
|
||||
'aabeb013-7093-4d32-ba97-e4e281a7dffd',
|
||||
'57b034dd-7ac9-4e40-a5ff-9833c1d516fc',
|
||||
'93375f26-ada3-4490-af12-91f6858b64fc',
|
||||
'4e819358-b61e-42fa-aa05-286de238f2f6',
|
||||
'b61fe05c-a8c3-439e-8c78-7ee52e223e8a',
|
||||
'e558ea51-6f7f-4b0e-99d3-46df7ae61a84',
|
||||
'acd531c1-9f6c-44ff-ba1b-95f71a37e06b',
|
||||
'0b3c8769-6048-4dfd-9372-c96da8d10193',
|
||||
'2fe19a46-e764-4529-9ac4-e37c6b396e1e',
|
||||
'819a28c7-f967-45b8-b94f-59726d425270',
|
||||
'f0135da4-9d86-4eb8-8292-0405fa8cd2c4',
|
||||
'd72ac779-4874-48ec-af86-b409a0f8ef31',
|
||||
'108077e9-7b41-4169-aeed-34b145202efe',
|
||||
'7aa43e17-9a14-48dc-8c96-c4281abbb332',
|
||||
'1a509a8f-c213-484a-a85b-389ccb1be529',
|
||||
'5798513c-be4c-4deb-be4c-9cafa30f4ff8',
|
||||
'fac20481-0235-4af5-b2ae-fed135a5e1e2',
|
||||
'86ef9755-a5bb-4068-9273-a5ca4cef6912',
|
||||
'850bbe11-da72-407c-ac75-37ba7b9597e3',
|
||||
'433d68f7-c02f-49b1-9faa-6f40520b9dfe',
|
||||
'd14e8023-1bab-49be-b9fe-8b8987f7b489',
|
||||
'f78feb38-4aa3-4801-b56d-0e43a9361bfc',
|
||||
'd4a187c0-a41a-4ed6-8206-1982c85131d3',
|
||||
'0baf29de-0f22-47c3-8640-031411ac3acc',
|
||||
'7881ddc2-c254-4f42-8d8a-3ba546a725b2',
|
||||
'f52cb36f-36d2-4b7c-860a-8e8b2b8b1b2d',
|
||||
'618f9080-765e-44e4-8688-551e57335834',
|
||||
'a92a4561-55e7-4cae-b0ad-cfd88c3b8549',
|
||||
'5d7b9373-8fbf-427c-988b-ab70216eb1a3',
|
||||
'f2b2eb42-98fc-4d0c-b76c-82453e7a7ad4',
|
||||
'ae9ee599-0361-4a6c-9e28-33769683b91d',
|
||||
'eaeb7546-83f4-4364-8775-c5f8c925d152',
|
||||
'60546de5-bce0-4f1f-9572-3d5a24488126',
|
||||
'496b2a9b-8082-4a31-829b-9ddaea1b8d72',
|
||||
'e86f7fd3-5e55-476e-9d54-88999db045f1',
|
||||
'b4df19ab-cee5-400f-a9e1-3d9a1ca60ab4',
|
||||
'286c5332-3abe-49b4-a94a-b3f74c99a1aa',
|
||||
'81115d6d-643c-466a-b602-6b6a9e2af463',
|
||||
'b9c0d5cd-7b23-4a0f-910f-2d74cdccc46b',
|
||||
'088c5dc0-5d4c-4a90-840a-f1109013625d',
|
||||
'46cf7b21-b0f2-483a-a816-d88699f15724',
|
||||
'ac7c54c5-4f41-4878-957f-8f5680302ee5',
|
||||
'de61c088-b9e3-4975-a3bd-61401d0f34ea',
|
||||
'c898f4c8-3611-447f-a59d-c6dc57b20c6f',
|
||||
'054f8331-8e90-402f-b321-cd9817c9b872',
|
||||
'd1f97e08-e66d-4738-a549-7e5ce5684b89',
|
||||
'c43a794a-26c4-4de9-96bd-6570ae8901f2',
|
||||
'8d979e7a-5bb8-4daa-92c0-530c575592e8',
|
||||
'5ec098a9-b638-4f91-a69c-4c877801df45',
|
||||
'a4bdd1cf-9b8c-4914-a728-57a1f5245b2a',
|
||||
'dfd687ff-6bdf-4ae2-a364-8f1a8abd29d4',
|
||||
'b6324133-b493-45f4-8598-c8c70b0df90e',
|
||||
'057b64e9-3457-48d7-8368-d58760b6fc92',
|
||||
'1351c083-0b5a-4fe6-87d3-801239ac42a6',
|
||||
'c0292658-18b4-4273-aae3-5af6b523fc65',
|
||||
'3616f400-4431-423d-b905-1a70904be63d',
|
||||
'ae735815-4a74-4af4-bc82-045f43f3d1ca',
|
||||
'1fd9e4bb-f592-4e5d-829e-2910222ec8c9',
|
||||
'30f4e69c-40d3-4402-8075-c85a3a801a6a',
|
||||
'9f3ddbf3-168a-483a-bd9d-1ffade99e816',
|
||||
'c777722e-5e72-41bb-a7a5-bbbdfe67e630',
|
||||
'72a7b8c8-c342-4dd2-b413-1a09f24e70a8',
|
||||
'd09c92df-e933-4016-af2f-89a99ce314ac',
|
||||
'22789e02-6e3e-490b-9c41-5e8a9d161ebc',
|
||||
'8374dcad-f51d-4c3c-b6ec-04b32644379b',
|
||||
'a34c9403-ee6f-4251-a8d3-838df56c33c5',
|
||||
'1b5165df-40c0-4832-8f9e-b5bc2df40c37',
|
||||
'2594664b-0eb9-43a1-859f-2726f763b76d',
|
||||
'86b94bd5-920e-468b-81c8-90bf502b39bb',
|
||||
'b394e352-e825-4dd1-b8e4-f03db6f5178d',
|
||||
'7d7b18f0-279f-4fc6-8fdc-3636d1bb76c8',
|
||||
'7fe9cc76-513b-4272-b54c-bfd91710b92a',
|
||||
'0b3cd1d8-994b-4e17-9a0d-2d01462b7bac',
|
||||
'131123b5-6290-45cb-b0dc-f96d82031f2c',
|
||||
'20c61fcd-17a4-409e-b53c-d19053b7657c',
|
||||
'fe57563b-2817-45a0-a5a6-d6d852824341',
|
||||
'724cce37-0290-4bb4-a385-e97af88ff308',
|
||||
'9ed98b9a-4d51-49d2-bdd9-ff983a664bd8',
|
||||
'321ad5af-fa69-46ca-a1e6-38c43df6c4d1',
|
||||
'a7eced90-a8ce-4891-bb4d-6931d2e63c42',
|
||||
'002f4512-6ab4-4a67-afde-120263f719bf',
|
||||
'3d888a45-c790-443a-b299-79bdbf180ea9',
|
||||
'166028e4-4cfd-4749-a898-c452cb4e5e3c',
|
||||
'596dc54c-34cd-4474-85ca-50c7b2bb4dec',
|
||||
'837b2e19-2258-47b6-9dd5-44f1729b916b',
|
||||
'5f5407de-f1bf-4fcc-a8c4-cd48920c5aef',
|
||||
'b6f634ea-ffcd-4de1-9669-0031dc689d61',
|
||||
'4d7494dd-90b6-45e7-8412-2dd554e20ce7',
|
||||
'aabf6703-5cb1-4f6c-bda2-bbf9f2137628',
|
||||
'7d6664fc-cb45-49be-95c9-4642d9fd8e1b',
|
||||
'3b47c3fb-a0f4-4dbc-8f99-19ed905cadf3',
|
||||
'2d31a2db-7791-4270-94c6-1653a3775c1a',
|
||||
'90160273-9bef-442b-aa36-393bdb3fcf38',
|
||||
'4d02d9bc-d81b-41da-b1e0-2d1ffde96103',
|
||||
'f8be054e-651d-4542-a3e4-681a4a2ec9d0',
|
||||
'966e9995-938a-4a5e-813c-de3691dddb3a'
|
||||
];
|
||||
|
||||
function v1 () {
|
||||
|
@ -1,7 +1,6 @@
|
||||
// @flow
|
||||
import * as db from '../common/database';
|
||||
import type {BaseModel} from './index';
|
||||
import uuid from 'uuid';
|
||||
export const name = 'Cookie Jar';
|
||||
export const type = 'CookieJar';
|
||||
export const prefix = 'jar';
|
||||
@ -66,7 +65,7 @@ export function update (cookieJar: CookieJar, patch: Object = {}) {
|
||||
function migrateCookieId (cookieJar: CookieJar) {
|
||||
for (const cookie of cookieJar.cookies) {
|
||||
if (!cookie.id) {
|
||||
cookie.id = uuid.v4();
|
||||
cookie.id = Math.random().toString().replace('0.', '');
|
||||
}
|
||||
}
|
||||
return cookieJar;
|
||||
|
@ -1,7 +1,6 @@
|
||||
// @flow
|
||||
import React, {PureComponent} from 'react';
|
||||
import uuid from 'uuid';
|
||||
import {Tabs, TabList, Tab, TabPanel} from 'react-tabs';
|
||||
import {Tab, TabList, TabPanel, Tabs} from 'react-tabs';
|
||||
import autobind from 'autobind-decorator';
|
||||
import deepEqual from 'deep-equal';
|
||||
import * as toughCookie from 'tough-cookie';
|
||||
|
@ -123,9 +123,6 @@ class CookiesModal extends PureComponent {
|
||||
}
|
||||
|
||||
async show () {
|
||||
// Opened without cookie jar. Bail out and create one
|
||||
const {cookieJar, workspace} = this.props;
|
||||
|
||||
setTimeout(() => {
|
||||
this.filterInput && this.filterInput.focus();
|
||||
}, 100);
|
||||
|
@ -21,6 +21,12 @@ import {isDevelopment} from '../common/constants';
|
||||
await initAnalytics(getAccountId());
|
||||
await initPlugins();
|
||||
|
||||
// Make sure CookieJars and environments exist for all workspaces
|
||||
for (const workspace of await models.workspace.all()) {
|
||||
await models.cookieJar.getOrCreateForParentId(workspace._id);
|
||||
await models.environment.getOrCreateForWorkspace(workspace);
|
||||
}
|
||||
|
||||
// Create Redux store
|
||||
const store = await initStore();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user