Skip to content

Commit 27f80f3

Browse files
committed
fixing incorrect Error types between spec & source for changes.js
1 parent e0ae516 commit 27f80f3

File tree

1 file changed

+4
-4
lines changed
  • contentcuration/contentcuration/frontend/shared/data/__tests__

1 file changed

+4
-4
lines changed

contentcuration/contentcuration/frontend/shared/data/__tests__/changes.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ describe('Change Types Unhappy Paths', () => {
356356
it('should throw error when Change is instantiated without a source', () => {
357357
expect(
358358
() => new Change({ key: '1', table: TABLE_NAMES.CONTENTNODE, type: CHANGE_TYPES.CREATED }),
359-
).toThrow(new ReferenceError('source should be a string, but undefined was passed instead'));
359+
).toThrow(new TypeError('source should be a string, but undefined was passed instead'));
360360
});
361361

362362
it('should throw error when Change is instantiated with a non-string source', () => {
@@ -368,7 +368,7 @@ describe('Change Types Unhappy Paths', () => {
368368
table: TABLE_NAMES.CONTENTNODE,
369369
type: CHANGE_TYPES.CREATED,
370370
}),
371-
).toThrow(new ReferenceError('source should be a string, but 123 was passed instead'));
371+
).toThrow(new TypeError('source should be a string, but 123 was passed instead'));
372372
});
373373

374374
it('should throw error when Change is instantiated with invalid table', () => {
@@ -386,7 +386,7 @@ describe('Change Types Unhappy Paths', () => {
386386
source: CLIENTID,
387387
type: CHANGE_TYPES.CREATED,
388388
}),
389-
).toThrow(new TypeError('session is not a syncable table'));
389+
).toThrow(new ReferenceError('session is not a syncable table'));
390390
});
391391

392392
// CreatedChange
@@ -502,7 +502,7 @@ describe('Change Types Unhappy Paths', () => {
502502
source: CLIENTID,
503503
oldObj,
504504
}),
505-
).toThrow(new ReferenceError('parent is required for a MovedChange but it was undefined'));
505+
).toThrow(new TypeError('parent is required for a MovedChange but it was undefined'));
506506
});
507507

508508
// CopiedChange

0 commit comments

Comments
 (0)