mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 19:47: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.store = this.owner.lookup('service:store');
|
||||||
this.model = this.store.createRecord('mfa-method');
|
this.model = this.store.createRecord('mfa-method');
|
||||||
this.model.type = 'totp';
|
this.model.type = 'totp';
|
||||||
|
this.model.id = 'some-id';
|
||||||
});
|
});
|
||||||
|
|
||||||
test('it should render correct fields', async function (assert) {
|
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`);
|
.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);
|
assert.expect(3);
|
||||||
|
|
||||||
this.server.post('/identity/mfa/method/totp', () => {
|
this.server.post('/identity/mfa/method/totp/some-id', () => {
|
||||||
assert.ok(true, 'create request sent to server');
|
assert.ok(true, 'edit request sent to server');
|
||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ module('Integration | Component | pki | Page::PkiIssuerEditPage::PkiIssuerEdit',
|
|||||||
'http://localhost:8200',
|
'http://localhost:8200',
|
||||||
'Updated issuing certificates sent in POST request'
|
'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 });
|
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'
|
'sends params in correct type'
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
|
request_id: 'test',
|
||||||
data: {
|
data: {
|
||||||
mapping: { 'issuer-id': 'key-id' },
|
mapping: { 'issuer-id': 'key-id' },
|
||||||
},
|
},
|
||||||
@@ -100,6 +101,7 @@ module('Integration | Component | PkiImportPemBundle', function (hooks) {
|
|||||||
'sends params in correct type'
|
'sends params in correct type'
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
|
request_id: 'test',
|
||||||
data: {
|
data: {
|
||||||
mapping: {},
|
mapping: {},
|
||||||
},
|
},
|
||||||
@@ -131,6 +133,7 @@ module('Integration | Component | PkiImportPemBundle', function (hooks) {
|
|||||||
assert.expect(9);
|
assert.expect(9);
|
||||||
this.server.post(`/${this.backend}/issuers/import/bundle`, () => {
|
this.server.post(`/${this.backend}/issuers/import/bundle`, () => {
|
||||||
return {
|
return {
|
||||||
|
request_id: 'test',
|
||||||
data: {
|
data: {
|
||||||
imported_issuers: ['issuer-id', 'another-issuer'],
|
imported_issuers: ['issuer-id', 'another-issuer'],
|
||||||
imported_keys: ['key-id', 'another-key'],
|
imported_keys: ['key-id', 'another-key'],
|
||||||
|
|||||||
@@ -133,14 +133,20 @@ module('Integration | Component | pki issuer cross sign', function (hooks) {
|
|||||||
},
|
},
|
||||||
'payload contains correct key ref'
|
'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.server.post(
|
||||||
`/${this.backend}/issuer/${this.parentIssuerData.issuer_name}/sign-intermediate`,
|
`/${this.backend}/issuer/${this.parentIssuerData.issuer_name}/sign-intermediate`,
|
||||||
(schema, req) => {
|
(schema, req) => {
|
||||||
assert.ok(true, 'Step 3. POST request is made to sign CSR with new parent issuer');
|
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');
|
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) => {
|
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'
|
'payload contains pem bundle'
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
|
request_id: '1234',
|
||||||
data: {
|
data: {
|
||||||
imported_issuers: null,
|
imported_issuers: null,
|
||||||
imported_keys: null,
|
imported_keys: null,
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ module('Integration | Component | pki key form', function (hooks) {
|
|||||||
},
|
},
|
||||||
'sends params in correct type'
|
'sends params in correct type'
|
||||||
);
|
);
|
||||||
return {};
|
return { key_id: 'test' };
|
||||||
});
|
});
|
||||||
|
|
||||||
this.onSave = () => assert.ok(true, 'onSave callback fires on save success');
|
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'
|
'sends params in correct type'
|
||||||
);
|
);
|
||||||
return {};
|
return { key_id: 'test' };
|
||||||
});
|
});
|
||||||
this.onSave = () => assert.ok(true, 'onSave callback fires on save success');
|
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 },
|
{ tidy_acme: false },
|
||||||
'response contains manual tidy params'
|
'response contains manual tidy params'
|
||||||
);
|
);
|
||||||
|
return { id: 'pki-manual-tidy' };
|
||||||
});
|
});
|
||||||
this.onSave = () => assert.ok(true, 'onSave callback fires on save success');
|
this.onSave = () => assert.ok(true, 'onSave callback fires on save success');
|
||||||
this.onCancel = () => assert.ok(true, 'onCancel callback fires on save success');
|
this.onCancel = () => assert.ok(true, 'onCancel callback fires on save success');
|
||||||
|
|||||||
Reference in New Issue
Block a user