/** * Copyright (c) HashiCorp, Inc. * SPDX-License-Identifier: BUSL-1.1 */ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render, fillIn } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { setupMirage } from 'ember-cli-mirage/test-support'; import { setupEngine } from 'ember-engines/test-support'; import Sinon from 'sinon'; import { SELECTORS } from 'vault/tests/helpers/pki/pki-role-generate'; import { allowAllCapabilitiesStub } from 'vault/tests/helpers/stubs'; module('Integration | Component | pki-role-generate', function (hooks) { setupRenderingTest(hooks); setupMirage(hooks); setupEngine(hooks, 'pki'); hooks.beforeEach(async function () { this.server.post('/sys/capabilities-self', allowAllCapabilitiesStub()); this.store = this.owner.lookup('service:store'); this.secretMountPath = this.owner.lookup('service:secret-mount-path'); this.secretMountPath.currentPath = 'pki-test'; this.model = this.store.createRecord('pki/certificate/generate', { role: 'my-role', }); this.onSuccess = Sinon.spy(); }); test('it should render the component with the form by default', async function (assert) { assert.expect(4); await render( hbs`