Skip to content

Commit

Permalink
try simpler test
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbanister committed Jan 19, 2024
1 parent 49fb839 commit 0a95c18
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ describe('when performing crud operations', () => {
});
});

describe('when getting a resource by ID that does not exist', () => {
it('returns 404', async () => {
const randomUuid: string = '274fa5ec-fb0b-4759-b0dc-f2858703f1a3';
const response = await getResourceByLocation(randomUuid);
expect(response.statusCode).toEqual(404);
});
});

describe('when getting a resource by ID', () => {
describe('given the resource exists', () => {
let createdResourceLocation: string;
Expand All @@ -73,12 +81,6 @@ describe('when performing crud operations', () => {
expect(getResponse.body).toEqual(expect.objectContaining(resourceBody));
});

it('returns 404 when getting a different resource', async () => {
const randomUuid: string = '274fa5ec-fb0b-4759-b0dc-f2858703f1a3';
const response = await getResourceByLocation(randomUuid);
expect(response.statusCode).toEqual(404);
});

it('should match the location', async () => {
const id = await getResourceByLocation(createdResourceLocation).then((response) => response.body.id);

Expand Down

0 comments on commit 0a95c18

Please sign in to comment.