Skip to content

Commit

Permalink
added test for error
Browse files Browse the repository at this point in the history
  • Loading branch information
YoussefBouch committed Jul 9, 2024
1 parent 6987538 commit 4310b7a
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { PersonenkontexteUpdateError } from './personenkontexte-update.error.js';
import { UpdateInvalidLastModifiedError } from './update-invalid-last-modified.error.js';

describe('UpdateInvalidLastModified', () => {
it('should create an instance of UpdateInvalidLastModifiedError', () => {
const error: UpdateInvalidLastModifiedError = new UpdateInvalidLastModifiedError();

expect(error).toBeInstanceOf(UpdateInvalidLastModifiedError);
expect(error).toBeInstanceOf(PersonenkontexteUpdateError);
});

it('should have the correct error message', () => {
const error: UpdateInvalidLastModifiedError = new UpdateInvalidLastModifiedError();

expect(error.message).toBe(
'Personenkontexte could not be updated because the sent lastModified value is invalid!',
);
});

it('should handle no details gracefully', () => {
const error: UpdateInvalidLastModifiedError = new UpdateInvalidLastModifiedError();

expect(error.details).toBeUndefined();
});
});

0 comments on commit 4310b7a

Please sign in to comment.