-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from bbc/NEWSART-546-serve-articles-data
Statically serve files in /data
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
describe('Static Articles data', () => { | ||
let responseStatus; | ||
let responseBody; | ||
|
||
const testScenarioResponse = (title, assertion) => { | ||
it(title, () => { | ||
assertion(); | ||
}); | ||
}; | ||
|
||
beforeEach(() => { | ||
cy.request(`/data/scenario-01.json`).then(({ status, body }) => { | ||
responseStatus = status; | ||
responseBody = body; | ||
}); | ||
}); | ||
|
||
testScenarioResponse('should return a 200 status code', () => { | ||
expect(responseStatus).to.eq(200); | ||
}); | ||
|
||
describe('Response Body', () => { | ||
testScenarioResponse('should be an object', () => { | ||
expect(responseBody).to.be.an('object'); | ||
}); | ||
|
||
testScenarioResponse('should contain a blocks object', () => { | ||
expect(responseBody).to.have.property('blocks'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters