mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
* 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>
34 lines
1.2 KiB
JavaScript
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');
|
|
});
|
|
});
|