Skip to content

Commit

Permalink
tests(Application): use more robust key for identification
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Fraichot committed Nov 6, 2018
1 parent 851bbe5 commit 6c65d71
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/application/actions/shareSocialNetwork.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('shareSocialNetwork action creator test suite', function () {
let wasCalled = false;
function assertFunction (e) {
wasCalled = true;
expect(e.detail.certificateDefinition.transactionId).toEqual(validCertificate.transactionId);
expect(e.detail.certificateDefinition.id).toEqual(validCertificate.id);
}
window.addEventListener(CERTIFICATE_EVENTS.CERTIFICATE_SHARE, assertFunction);

Expand Down
4 changes: 2 additions & 2 deletions test/application/actions/updateCertificateDefinition.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('updateCertificateDefinition action creator test suite', function () {
await store.dispatch(updateCertificateDefinition(certificateFixture));
const state = store.getState();

expect(getCertificateDefinition(state).transactionId).toEqual(validCertificate.transactionId);
expect(getCertificateDefinition(state).id).toEqual(validCertificate.id);
});

it('should set the error in the state to undefined', async function () {
Expand All @@ -50,7 +50,7 @@ describe('updateCertificateDefinition action creator test suite', function () {
let wasCalled = false;
function assertFunction (e) {
wasCalled = true;
expect(e.detail.certificateDefinition.transactionId).toEqual(validCertificate.transactionId);
expect(e.detail.certificateDefinition.id).toEqual(validCertificate.id);
}
window.addEventListener(CERTIFICATE_EVENTS.CERTIFICATE_LOAD, assertFunction);

Expand Down
4 changes: 2 additions & 2 deletions test/application/actions/updateCertificateUrl.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('updateCertificateUrl action creator test suite', function () {
it('should update the state with the valid certificate definition', async function () {
await store.dispatch(updateCertificateUrl(MOCK_SERVER_VALID_URL));
const state = store.getState();
expect(getCertificateDefinition(state).transactionId).toEqual(validCertificate.transactionId);
expect(getCertificateDefinition(state).id).toEqual(validCertificate.id);
});
});

Expand All @@ -71,7 +71,7 @@ describe('updateCertificateUrl action creator test suite', function () {
await store.dispatch(updateCertificateUrl(MOCK_SERVER_INVALID_URL));

const state = store.getState();
expect(getCertificateDefinition(state).transactionId).toEqual(invalidCertificate.transactionId);
expect(getCertificateDefinition(state).id).toEqual(invalidCertificate.id);
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/application/actions/verifyCertificate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('verifyCertificate action creator test suite', function () {
let wasCalled = false;
function assertFunction (e) {
wasCalled = true;
expect(e.detail.certificateDefinition.transactionId).toEqual(validCertificate.transactionId);
expect(e.detail.certificateDefinition.id).toEqual(validCertificate.id);
}
window.addEventListener(CERTIFICATE_EVENTS.CERTIFICATE_VERIFY, assertFunction);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import validCertificate from '../../../../assertions/validCertificate';
describe('domain certificates parse method test suite', function () {
describe('given a valid definition of a certificate', function () {
it('should return an object with a certificate definition', function () {
expect(domain.certificates.parse(certificateFixture).certificateDefinition.transactionId).toEqual(validCertificate.transactionId);
expect(domain.certificates.parse(certificateFixture).certificateDefinition.id).toEqual(validCertificate.id);
});

it('should return an object with errorMessage property undefined', function () {
Expand Down
2 changes: 1 addition & 1 deletion test/application/domain/events/useCases/dispatch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('domain events dispatch method test suite', function () {
let wasCalled = false;
function assertFunction (e) {
wasCalled = true;
expect(e.detail.certificateDefinition.transactionId).toEqual(validCertificate.transactionId);
expect(e.detail.certificateDefinition.id).toEqual(validCertificate.id);
}
window.addEventListener(eventType, assertFunction);

Expand Down

0 comments on commit 6c65d71

Please sign in to comment.