-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c0616e
commit a6a13d2
Showing
2 changed files
with
97 additions
and
8 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,97 @@ | ||
const deckData = | ||
[ | ||
{ | ||
"id": 1, | ||
"name": "German vocabulary", | ||
"cards": [ | ||
{ | ||
"question": "die Bestätigung", | ||
"canonical_answer": "confirmation", | ||
"alternate_answers": [ "verification", "certificate", "endorsement" ] | ||
}, | ||
{ | ||
"question": "die Geige", | ||
"canonical_answer": "violin", | ||
"alternate_answers": [ "fiddle" ] | ||
}, | ||
{ | ||
"question": "reden", | ||
"canonical_answer": "to converse", | ||
"alternate_answers": [ "to talk", "converse", "talk" ] | ||
} | ||
] | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "Chemical symbols", | ||
"cards": [ | ||
{ | ||
"question": "C", | ||
"canonical_answer": "carbon", | ||
"alternate_answers": [] | ||
}, | ||
{ | ||
"question": "Fe", | ||
"canonical_answer": "iron", | ||
"alternate_answers": [ ] | ||
} | ||
] | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "State capitals", | ||
"cards": [ | ||
{ | ||
"question": "Montpelier", | ||
"canonical_answer": "Vermont", | ||
"alternate_answers": [ "VT" ] | ||
}, | ||
{ | ||
"question": "Annapolis", | ||
"canonical_answer": "Maryland", | ||
"alternate_answers": [ "MD" ] | ||
}, | ||
{ | ||
"question": "Albany", | ||
"canonical_answer": "New York", | ||
"alternate_answers": [ "NY" ] | ||
}, | ||
{ | ||
"question": "Sacramento", | ||
"canonical_answer": "California", | ||
"alternate_answers": [ "CA" ] | ||
} | ||
] | ||
} | ||
] | ||
|
||
describe('My First Test', () => { | ||
beforeEach(function () { | ||
cy.server() | ||
cy.route({ | ||
method: 'GET', | ||
url: '/phildarnowsky/e28_p3_api/decks', | ||
response: JSON.stringify(deckData) | ||
}) | ||
}) | ||
|
||
it('Visits the app root url', () => { | ||
cy.visit('/') | ||
cy.contains('h1', 'Available Decks') | ||
}) | ||
|
||
it('Has a link to each available deck', () => { | ||
cy.visit('/') | ||
cy.contains('a', 'German vocabulary') | ||
cy.contains('a', 'Chemical symbols') | ||
cy.contains('a', 'State capitals') | ||
cy.contains('a', 'Chemical symbols').click() | ||
cy.contains('h1', 'Chemical symbols') | ||
}) | ||
|
||
it('Has a link to the stats page', () => { | ||
cy.visit('/') | ||
cy.contains('a', 'View stats').click() | ||
cy.contains('h1', 'Stats') | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.