mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
id changes on tests
This commit is contained in:
@@ -17,6 +17,7 @@ module('Integration | Component | mfa-method-form', function (hooks) {
|
||||
this.store = this.owner.lookup('service:store');
|
||||
this.model = this.store.createRecord('mfa-method');
|
||||
this.model.type = 'totp';
|
||||
this.model.id = 'some-id';
|
||||
});
|
||||
|
||||
test('it should render correct fields', async function (assert) {
|
||||
@@ -38,11 +39,11 @@ module('Integration | Component | mfa-method-form', function (hooks) {
|
||||
.exists(`Max validation attempts field input renders`);
|
||||
});
|
||||
|
||||
test('it should create new mfa method', async function (assert) {
|
||||
test('it should edit a new mfa method', async function (assert) {
|
||||
assert.expect(3);
|
||||
|
||||
this.server.post('/identity/mfa/method/totp', () => {
|
||||
assert.ok(true, 'create request sent to server');
|
||||
this.server.post('/identity/mfa/method/totp/some-id', () => {
|
||||
assert.ok(true, 'edit request sent to server');
|
||||
return {};
|
||||
});
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ module('Integration | Component | pki | Page::PkiIssuerEditPage::PkiIssuerEdit',
|
||||
'http://localhost:8200',
|
||||
'Updated issuing certificates sent in POST request'
|
||||
);
|
||||
return { data };
|
||||
return { issuer_id: 'test', data };
|
||||
});
|
||||
await render(hbs`<Page::PkiIssuerEdit @model={{this.model}} />`, { owner: this.engine });
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ module('Integration | Component | PkiImportPemBundle', function (hooks) {
|
||||
'sends params in correct type'
|
||||
);
|
||||
return {
|
||||
request_id: 'test',
|
||||
data: {
|
||||
mapping: { 'issuer-id': 'key-id' },
|
||||
},
|
||||
@@ -100,6 +101,7 @@ module('Integration | Component | PkiImportPemBundle', function (hooks) {
|
||||
'sends params in correct type'
|
||||
);
|
||||
return {
|
||||
request_id: 'test',
|
||||
data: {
|
||||
mapping: {},
|
||||
},
|
||||
@@ -131,6 +133,7 @@ module('Integration | Component | PkiImportPemBundle', function (hooks) {
|
||||
assert.expect(9);
|
||||
this.server.post(`/${this.backend}/issuers/import/bundle`, () => {
|
||||
return {
|
||||
request_id: 'test',
|
||||
data: {
|
||||
imported_issuers: ['issuer-id', 'another-issuer'],
|
||||
imported_keys: ['key-id', 'another-key'],
|
||||
|
||||
@@ -133,14 +133,20 @@ module('Integration | Component | pki issuer cross sign', function (hooks) {
|
||||
},
|
||||
'payload contains correct key ref'
|
||||
);
|
||||
return { data: { csr: newCSR.csr, key_id: this.intIssuerData.key_id } };
|
||||
return {
|
||||
data: { csr: newCSR.csr, key_id: this.intIssuerData.key_id },
|
||||
request_id: '1234',
|
||||
};
|
||||
});
|
||||
this.server.post(
|
||||
`/${this.backend}/issuer/${this.parentIssuerData.issuer_name}/sign-intermediate`,
|
||||
(schema, req) => {
|
||||
assert.ok(true, 'Step 3. POST request is made to sign CSR with new parent issuer');
|
||||
assert.propEqual(JSON.parse(req.requestBody), newCSR, 'payload has common name and csr');
|
||||
return { data: { ca_chain: [newlySignedCert, parentIssuerCert] } };
|
||||
return {
|
||||
data: { ca_chain: [newlySignedCert, parentIssuerCert] },
|
||||
request_id: '1234',
|
||||
};
|
||||
}
|
||||
);
|
||||
this.server.post(`/${this.intMountPath}/issuers/import/bundle`, (schema, req) => {
|
||||
@@ -151,6 +157,7 @@ module('Integration | Component | pki issuer cross sign', function (hooks) {
|
||||
'payload contains pem bundle'
|
||||
);
|
||||
return {
|
||||
request_id: '1234',
|
||||
data: {
|
||||
imported_issuers: null,
|
||||
imported_keys: null,
|
||||
|
||||
@@ -69,7 +69,7 @@ module('Integration | Component | pki key form', function (hooks) {
|
||||
},
|
||||
'sends params in correct type'
|
||||
);
|
||||
return {};
|
||||
return { key_id: 'test' };
|
||||
});
|
||||
|
||||
this.onSave = () => assert.ok(true, 'onSave callback fires on save success');
|
||||
@@ -106,7 +106,7 @@ module('Integration | Component | pki key form', function (hooks) {
|
||||
},
|
||||
'sends params in correct type'
|
||||
);
|
||||
return {};
|
||||
return { key_id: 'test' };
|
||||
});
|
||||
this.onSave = () => assert.ok(true, 'onSave callback fires on save success');
|
||||
|
||||
|
||||
@@ -291,6 +291,7 @@ module('Integration | Component | pki tidy form', function (hooks) {
|
||||
{ tidy_acme: false },
|
||||
'response contains manual tidy params'
|
||||
);
|
||||
return { id: 'pki-manual-tidy' };
|
||||
});
|
||||
this.onSave = () => assert.ok(true, 'onSave callback fires on save success');
|
||||
this.onCancel = () => assert.ok(true, 'onCancel callback fires on save success');
|
||||
|
||||
Reference in New Issue
Block a user