Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
test: make test clearer
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Waller <[email protected]>
  • Loading branch information
Richard Waller authored and Richard Waller committed Apr 23, 2020
1 parent e592efb commit aaa0848
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/src/API/templates/templates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,12 @@ describe('Template API tests', function() {
});
describe('a duplicate url', function() {
it('should return 400', async function() {
// Arrange
const res = await getTemplateRepos();
const originalTemplateRepos = res.body;
const duplicateRepoUrl = originalTemplateRepos[0].url;
// Act
const duplicateUrlRes = await addTemplateRepo({
url: duplicateRepoUrl,
const { body: [existingRepo] } = await getTemplateRepos();
const res = await addTemplateRepo({
url: existingRepo.url,
description: 'duplicate url',
});
// Assert
duplicateUrlRes.should.have.status(400, duplicateUrlRes.text);
res.should.have.status(400, res.text);
});
});
describe('a valid url that does not point to an index.json', function() {
Expand Down

0 comments on commit aaa0848

Please sign in to comment.