Skip to content

Commit a3baff4

Browse files
committed
test(test:unit-jest): fix npm script
Refs #2710
1 parent d57eb8b commit a3baff4

File tree

4 files changed

+32
-30
lines changed

4 files changed

+32
-30
lines changed

test/unit/plugins/editor-metadata/index.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import SwaggerUi from 'swagger-ui';
1+
import SwaggerUI from 'swagger-ui';
22
import EditorMetadataPlugin from 'plugins/editor-metadata';
33

44
function getSystem(spec) {
55
return new Promise((resolve) => {
6-
const system = SwaggerUi({
6+
const system = SwaggerUI({
77
spec,
88
domNode: null,
99
presets: [
10-
SwaggerUi.plugins.SpecIndex,
11-
SwaggerUi.plugins.ErrIndex,
12-
SwaggerUi.plugins.DownloadUrl,
13-
SwaggerUi.plugins.SwaggerJsIndex,
10+
SwaggerUI.plugins.SpecIndex,
11+
SwaggerUI.plugins.ErrIndex,
12+
SwaggerUI.plugins.DownloadUrl,
13+
SwaggerUI.plugins.SwaggerJsIndex,
14+
SwaggerUI.plugins.RequestSnippetsIndex,
1415
],
1516
initialState: {
1617
layout: undefined
@@ -32,7 +33,7 @@ function getSystem(spec) {
3233
})
3334
]
3435
});
35-
36+
3637
resolve(system);
3738
});
3839
}
@@ -109,7 +110,7 @@ describe('editor metadata plugin', () => {
109110
});
110111
}
111112
);
112-
113+
113114
it('should return isValid for a valid spec', async () => {
114115
const spec = {
115116
swagger: '2.0',
@@ -133,7 +134,7 @@ describe('editor metadata plugin', () => {
133134
expect(system.getEditorMetadata().isValid).toBe(true);
134135
});
135136

136-
137+
137138
it('should return isValid for an invalid spec', async () => {
138139
const spec = {
139140
swagger: '2.0',

test/unit/plugins/selectors.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
import SwaggerUi from 'swagger-ui';
1+
import SwaggerUI from 'swagger-ui';
22
import ValidateBasePlugin from 'plugins/validate-base';
33
import ValidateSemanticPlugin from 'plugins/validate-semantic';
44
import ASTPlugin from 'plugins/ast';
55

66
function getSystem(spec) {
77
return new Promise((resolve) => {
8-
const system = SwaggerUi({
8+
const system = SwaggerUI({
99
spec,
1010
domNode: null,
1111
presets: [
12-
SwaggerUi.plugins.SpecIndex,
13-
SwaggerUi.plugins.ErrIndex,
14-
SwaggerUi.plugins.DownloadUrl,
15-
SwaggerUi.plugins.SwaggerJsIndex,
12+
SwaggerUI.plugins.SpecIndex,
13+
SwaggerUI.plugins.ErrIndex,
14+
SwaggerUI.plugins.DownloadUrl,
15+
SwaggerUI.plugins.SwaggerJsIndex,
16+
SwaggerUI.plugins.RequestSnippetsIndex,
1617
],
1718
initialState: {
1819
layout: undefined

test/unit/plugins/validate-semantic/validate-helper.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
import SwaggerUi from 'swagger-ui';
1+
import SwaggerUI from 'swagger-ui';
32
import debounce from 'lodash/debounce';
43

54
import ValidateBasePlugin from 'plugins/validate-base';
@@ -12,15 +11,16 @@ const DELAY_MS = (typeof envDelay === 'string' ? parseInt(envDelay) : envDelay)
1211

1312
export default function validateHelper(spec) {
1413
return new Promise((resolve) => {
15-
const system = SwaggerUi({
14+
const system = SwaggerUI({
1615
spec,
1716
domNode: null,
1817
presets: [
19-
SwaggerUi.plugins.SpecIndex,
20-
SwaggerUi.plugins.ErrIndex,
21-
SwaggerUi.plugins.DownloadUrl,
22-
SwaggerUi.plugins.SwaggerJsIndex,
23-
SwaggerUi.plugins.Oas3Index
18+
SwaggerUI.plugins.SpecIndex,
19+
SwaggerUI.plugins.ErrIndex,
20+
SwaggerUI.plugins.DownloadUrl,
21+
SwaggerUI.plugins.SwaggerJsIndex,
22+
SwaggerUI.plugins.Oas3Index,
23+
SwaggerUI.plugins.RequestSnippetsIndex,
2424
],
2525
initialState: {
2626
layout: undefined

test/unit/standalone/topbar-insert/index.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
21
import React from 'react';
3-
import SwaggerUi from 'swagger-ui';
2+
import SwaggerUI from 'swagger-ui';
43
import insertPlugin from 'src/standalone/topbar-insert';
54
import { fromJS } from 'immutable';
65
import { configure, mount } from 'enzyme';
@@ -10,14 +9,15 @@ configure({ adapter: new Adapter() });
109

1110
function getSystem(spec) {
1211
return new Promise((resolve) => {
13-
const system = SwaggerUi({
12+
const system = SwaggerUI({
1413
spec,
1514
domNode: null,
1615
presets: [
17-
SwaggerUi.plugins.SpecIndex,
18-
SwaggerUi.plugins.ErrIndex,
19-
SwaggerUi.plugins.DownloadUrl,
20-
SwaggerUi.plugins.SwaggerJsIndex,
16+
SwaggerUI.plugins.SpecIndex,
17+
SwaggerUI.plugins.ErrIndex,
18+
SwaggerUI.plugins.DownloadUrl,
19+
SwaggerUI.plugins.SwaggerJsIndex,
20+
SwaggerUI.plugins.RequestSnippetsIndex,
2121
],
2222
initialState: {
2323
layout: undefined

0 commit comments

Comments
 (0)