Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-06 06:08:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-06 06:08:30 +0300
commit47efbe732cd3251aae4b13792fa058210e8328ab (patch)
tree73b578df013d6257efe251b6fd930032b19dcf19 /spec/frontend/blob
parentf38bcf2e443dd89acc774a2fa1efa2e881a67a90 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/blob')
-rw-r--r--spec/frontend/blob/openapi/index_spec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/frontend/blob/openapi/index_spec.js b/spec/frontend/blob/openapi/index_spec.js
new file mode 100644
index 00000000000..4b3d3ce2d35
--- /dev/null
+++ b/spec/frontend/blob/openapi/index_spec.js
@@ -0,0 +1,23 @@
+import { SwaggerUIBundle } from 'swagger-ui-dist';
+import renderOpenApi from '~/blob/openapi';
+
+jest.mock('swagger-ui-dist');
+
+describe('OpenAPI blob viewer', () => {
+ const id = 'js-openapi-viewer';
+ const mockEndpoint = 'some/endpoint';
+
+ beforeEach(() => {
+ setFixtures(`<div id="${id}" data-endpoint="${mockEndpoint}"></div>`);
+ renderOpenApi();
+ });
+
+ it('initializes SwaggerUI with the correct configuration', () => {
+ expect(SwaggerUIBundle).toHaveBeenCalledWith({
+ url: mockEndpoint,
+ dom_id: `#${id}`,
+ deepLinking: true,
+ displayOperationId: true,
+ });
+ });
+});