id changes on tests

This commit is contained in:
Angel Garbarino
2024-01-08 09:53:22 -08:00
parent f160e1ae50
commit 7387408bd9
6 changed files with 20 additions and 8 deletions

View File

@@ -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 {};
});

View File

@@ -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 });

View File

@@ -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'],

View File

@@ -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,

View File

@@ -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');

View File

@@ -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');