Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
hellobontempo committed Dec 26, 2024
1 parent 7dc1352 commit 100a65a
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import { setupMirage } from 'ember-cli-mirage/test-support';
const selectors = {
form: '[data-test-sign-intermediate-form]',
csrInput: '[data-test-input="csr"]',
toggleSigningOptions: '[data-test-toggle-group="Signing options"]',
toggleSANOptions: '[data-test-toggle-group="Subject Alternative Name (SAN) Options"]',
toggleAdditionalFields: '[data-test-toggle-group="Additional subject fields"]',
toggleGroup: (group) => `[data-test-toggle-group="${group}"]`,
fieldByName: (name) => `[data-test-field="${name}"]`,
saveButton: '[data-test-pki-sign-intermediate-save]',
cancelButton: '[data-test-pki-sign-intermediate-cancel]',
Expand All @@ -40,19 +38,24 @@ module('Integration | Component | pki-sign-intermediate-form', function (hooks)
});

test('renders correctly on load', async function (assert) {
assert.expect(9);
assert.expect(10);
await render(hbs`<PkiSignIntermediateForm @onCancel={{this.onCancel}} @model={{this.model}} />`, {
owner: this.engine,
});

assert.dom(selectors.form).exists('Form is rendered');
assert.dom(selectors.resultsContainer).doesNotExist('Results display not rendered');
assert.dom('[data-test-field]').exists({ count: 10 }, '10 default fields shown');
assert.dom(selectors.toggleSigningOptions).exists();
assert.dom(selectors.toggleSANOptions).exists();
assert.dom(selectors.toggleAdditionalFields).exists();
assert.dom('[data-test-field]').exists({ count: 9 }, '9 default fields shown');
[
'Name constraints',
'Signing options',
'Subject Alternative Name (SAN) Options',
'Additional subject fields',
].forEach((group) => {
assert.dom(selectors.toggleGroup(group)).exists(`${group} renders`);
});

await click(selectors.toggleSigningOptions);
await click(selectors.toggleGroup('Signing options'));
['usePss', 'skid', 'signatureBits'].forEach((name) => {
assert.dom(selectors.fieldByName(name)).exists();
});
Expand Down

0 comments on commit 100a65a

Please sign in to comment.