Files
vault/ui/tests/integration/components/open-api-explorer/swagger-ui-test.js
Angel Garbarino 6de5b2fb3c Update packages and OpenApi styling (#23700)
* update packages

* changelog

* wip better

* clean up

* and it works, it always worked we just hid it working :/

* clean up

* playing around with adding the queryparam, not working

* the fix no queryparams

* lets just see how this works out.

* maybe this will help

* remove copy/pasta

* Update ui/lib/open-api-explorer/addon/components/swagger-ui.js

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>

---------

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>
2023-10-25 17:06:06 +00:00

34 lines
1.2 KiB
JavaScript

import { module, test } from 'qunit';
import { setupRenderingTest } from 'vault/tests/helpers';
import { waitUntil, find } from '@ember/test-helpers';
import { setupEngine } from 'ember-engines/test-support';
import { setupMirage } from 'ember-cli-mirage/test-support';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | open-api-explorer | swagger-ui', function (hooks) {
setupRenderingTest(hooks);
setupEngine(hooks, 'open-api-explorer');
setupMirage(hooks);
hooks.beforeEach(function () {
this.store = this.owner.lookup('service:store');
});
test('it renders', async function (assert) {
assert.expect(2);
const openApiResponse = this.server.create('open-api-explorer');
this.server.get('sys/internal/specs/openapi', () => {
return openApiResponse;
});
await render(hbs`<SwaggerUi/>`, {
owner: this.engine,
});
await waitUntil(() => find('[data-test-swagger-ui]'));
assert.dom('[data-test-swagger-ui]').exists('renders component');
await waitUntil(() => find('.operation-filter-input'));
assert.dom('.opblock-post').exists({ count: 2 }, 'renders two blocks');
});
});