Skip to content
This repository has been archived by the owner on Sep 8, 2021. It is now read-only.

Add integration tests using Cypress #123

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ node_modules
# testing
coverage

# Cypress
cypress/screenshots
cypress/videos

# production
build

Expand Down
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js
node_js:
- 10
cache:
directories:
- ~/.npm
- ~/.cache
install:
- npm ci
script:
- npm test
3 changes: 3 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"baseUrl": "http://localhost:4100"
}
175 changes: 175 additions & 0 deletions cypress/fixtures/articles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"articles": [
{
"slug": "how-to-train-your-dragon",
"title": "How to train your dragon",
"description": "Ever wonder how?",
"body": "It takes a Jacobian",
"tagList": ["dragons", "training"],
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:48:35.824Z",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "jake",
"bio": "I work at statefarm",
"image": "https://i.stack.imgur.com/xHWG8.jpg",
"following": false
}
},
{
"slug": "eternal-return-law-ubermensch",
"title": "Eternal-return law ubermensch",
"description": "Eternal-return law ubermensch decrepit holiest philosophy right merciful victorious philosophy ascetic mountains",
"body": "Eternal-return law ubermensch decrepit holiest philosophy right merciful victorious philosophy ascetic mountains. Gains holiest truth zarathustra victorious evil mountains. Value abstract holiest battle ultimate christianity sexuality justice faith faith christian insofar war. Ocean play suicide holiest burying truth love derive will philosophy love salvation contradict. Hope ascetic decrepit eternal-return ultimate pinnacle ultimate deceptions.",
"tagList": ["philosophy", "ubermensch"],
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:48:35.824Z",
"favorited": true,
"favoritesCount": 0,
"author": {
"username": "nietzsche",
"bio": "Contradict strong faith victorious merciful",
"image": "http://nietzsche-ipsum.com/nietzsche.jpg",
"following": false
}
},
{
"slug": "how-to-train-your-dragon-2",
"title": "How to train your dragon 2",
"description": "So toothless",
"body": "It a dragon",
"tagList": ["dragons", "training"],
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:48:35.824Z",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "jake",
"bio": "I work at statefarm",
"image": "https://i.stack.imgur.com/xHWG8.jpg",
"following": false
}
},
{
"slug": "transvaluation-reason-revaluation-zarathustra",
"title": "Transvaluation reason revaluation zarathustra",
"description": "Transvaluation reason revaluation zarathustra contradict endless passion evil chaos ocean superiority decieve sea",
"body": "Transvaluation reason revaluation zarathustra contradict endless passion evil chaos ocean superiority decieve sea. Oneself of law god hatred oneself transvaluation marvelous self sexuality. Snare law enlightenment joy madness sea horror war ultimate war noble zarathustra victorious pinnacle. Salvation grandeur morality self sexuality ultimate overcome depths ocean insofar. Horror dead derive pious christian inexpedient reason decrepit ultimate will. Love hatred play oneself burying dead faith war superiority deceptions contradict. Ultimate value ubermensch reason insofar.",
"tagList": ["morality", "zarathustra", "philosophy"],
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:48:35.824Z",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "nietzsche",
"bio": "Contradict strong faith victorious merciful",
"image": "http://nietzsche-ipsum.com/nietzsche.jpg",
"following": false
}
},
{
"slug": "webtwo-ipsum-unigo-udemy",
"title": "Webtwo ipsum unigo udemy",
"description": "Webtwo ipsum unigo udemy meevee udemy yammer convore voki, balihoo ebay zlio jumo",
"body": "Webtwo ipsum unigo udemy meevee udemy yammer convore voki, balihoo ebay zlio jumo. Dopplr kno jaiku, boxbe. Akismet zillow yuntaa zoodles meebo shopify, napster udemy eskobo ifttt. Wakoopa zoosk prezi blippy, ebay wesabe. Edmodo yammer orkut vimeo zoho, blippy yoono sclipo. Ning nuvvo loopt airbnb, knewton wikia akismet movity, jaiku mog. Spotify jajah jaiku zinch tumblr ngmoco meebo, mzinga oovoo jajah tumblr. Dropio heroku zimbra trulia wufoo joukuu trulia etsy doostang, zillow octopart imvu revver divvyshot babblely flickr.",
"tagList": [],
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:48:35.824Z",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "jesus.mcdonalid47",
"bio": "Web 2.0 startup names, just for the heck of it",
"image": "https://randomuser.me/api/portraits/men/92.jpg",
"following": false
}
},
{
"slug": "hipmunk-zillow-kazaa-gsnap-twitter-squidoo-cuil",
"title": "Hipmunk zillow kazaa gsnap twitter squidoo cuil",
"description": "Hipmunk zillow kazaa gsnap twitter squidoo cuil, scribd greplin babblely stypi hulu",
"body": "Hipmunk zillow kazaa gsnap twitter squidoo cuil, scribd greplin babblely stypi hulu. Prezi oovoo lanyrd yoono qeyno zillow, meevee foodzie doostang. Handango skype wakoopa yammer rovio waze, bitly spock wesabe kiko. Zooomr zoho empressr jibjab sclipo meebo nuvvo, ngmoco elgg weebly squidoo knewton. Chumby jabber bubbli twitter yuntaa doostang dopplr, oooj qeyno disqus udemy blyve. mzinga trulia insala. Blekko wufoo omgpop meebo jiglu, tumblr babblely voki. prezi bebo. Kaboodle imvu lala omgpop skype, shopify chumby. Edmodo oooj sifteo joost zoosk edmodo, flickr bebo voxy. Joyent oooj flickr chartly edmodo ngmoco, loopt wesabe nuvvo kazaa. Cuil jaiku tivo wakoopa heekya napster ifttt, twitter tivo kiko ideeli napster. Stypi sococo mozy, convore.",
"tagList": [],
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:48:35.824Z",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "jesus.mcdonalid47",
"bio": "Web 2.0 startup names, just for the heck of it",
"image": "https://randomuser.me/api/portraits/men/92.jpg",
"following": false
}
},
{
"slug": "dead-selfish-moral-reason",
"title": "Dead selfish moral reason",
"description": "Dead selfish moral reason christianity chaos endless strong snare",
"body": "Dead selfish moral reason christianity chaos endless strong snare. Joy grandeur selfish eternal-return christian dead. Virtues free hope passion hatred justice war good battle pinnacle deceptions god spirit pinnacle. Eternal-return sexuality faith selfish law ideal ideal convictions sea. Faith law derive revaluation prejudice fearful good ultimate faithful sexuality law. Suicide love contradict against good zarathustra mountains society salvation prejudice hope ideal reason. Intentions endless holiest law moral contradict self holiest morality pious merciful gains.",
"tagList": ["moral", "selfish", "philosophy"],
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:48:35.824Z",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "nietzsche",
"bio": "Contradict strong faith victorious merciful",
"image": "http://nietzsche-ipsum.com/nietzsche.jpg",
"following": false
}
},
{
"slug": "i-just-told-you-you-ve-killed-me",
"title": "I just told you! You've killed me!",
"description": "I never loved you. Is that a cooking show?",
"body": "I love this planet! I've got wealth, fame, and access to the depths of sleaze that those things bring. I usually try to keep my sadness pent up inside where it can fester quietly as a mental illness. Oh, how I wish I could believe or understand that! There's only one reasonable course of action now: kill Flexo!\n\nSpare me your space age technobabble, Attila the Hun! My fellow Earthicans, as I have explained in my book 'Earth in the Balance'', and the much more popular ''Harry Potter and the Balance of Earth', we need to defend our planet against pollution. Also dark wizards.",
"tagList": ["planet", "technobabble"],
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:48:35.824Z",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "bender",
"bio": "I'm sorry, guys. I never meant to hurt you. Just to destroy everything you ever believed in",
"image": "http://www.unboundworlds.com/wp-content/uploads/2012/03/bender2.jpg",
"following": false
}
},
{
"slug": "what-s-with-you-kids",
"title": "What's with you kids?",
"description": "Every other day it's food, food, food. Alright, I'll get you some stupid food.",
"body": "When I was first asked to make a film about my nephew, Hubert Farnsworth, I thought \"Why should I?\" Then later, Leela made the film. But if I did make it, you can bet there would have been more topless women on motorcycles. Roll film!\n\nIt may comfort you to know that Fry's death took only fifteen seconds, yet the pain was so intense, that it felt to him like fifteen years. And it goes without saying, it caused him to empty his bowels. You're going back for the Countess, aren't you?",
"tagList": ["planet", "motorcycles"],
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:48:35.824Z",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "bender",
"bio": "I'm sorry, guys. I never meant to hurt you. Just to destroy everything you ever believed in",
"image": "http://www.unboundworlds.com/wp-content/uploads/2012/03/bender2.jpg",
"following": false
}
},
{
"slug": "well-mercia-s-a-temperate-zone",
"title": "Well, Mercia's a temperate zone!",
"description": "What a strange person. Why do you think that she is a witch? We want a shrubbery!! Burn her anyway!",
"body": "Why do you think that she is a witch? We want a shrubbery!! Burn her! A newt? Why do you think that she is a witch?\n\nI'm not a witch. And the hat. She's a witch! Be quiet! Burn her!\n\nI have to push the pram a lot. The swallow may fly south with the sun, and the house martin or the plover may seek warmer climes in winter, yet these are not strangers to our land. We found them. And this isn't my nose. This is a false one.\n\nWell, what do you want? Bloody Peasant! Look, my liege! Found them? In Mercia?! The coconut's tropical! Burn her anyway! Ah, now we see the violence inherent in the system!\n\nWhat a strange person. I'm not a witch. Why do you think that she is a witch? Knights of Ni, we are but simple travelers who seek the enchanter who lives beyond these woods. We want a shrubbery!!\n\nListen. Strange women lying in ponds distributing swords is no basis for a system of government. Supreme executive power derives from a mandate from the masses, not from some farcical aquatic ceremony. Shut up!",
"tagList": ["mercia", "witch"],
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:48:35.824Z",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "monty.python",
"bio": "You can't expect to wield supreme power just 'cause some watery tart threw a sword at you!",
"image": "https://images-na.ssl-images-amazon.com/images/I/710PzQnaomL._SY445_.jpg",
"following": false
}
}
],
"articlesCount": 20
}
40 changes: 40 additions & 0 deletions cypress/fixtures/authentication.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"jake": {
"email": "[email protected]",
"token": "1200cf8ad3.28a60559cf.5e7c5f46ee",
"username": "jake",
"bio": "I work at statefarm",
"image": "https://i.stack.imgur.com/xHWG8.jpg"
},
"nietzsche": {
"email": "[email protected]",
"token": "40a8a36c43.da3a787b87.0ebcb2d769",
"username": "nietzsche",
"bio": "Contradict strong faith victorious merciful",
"image": "http://nietzsche-ipsum.com/nietzsche.jpg"
},
"jesus.mcdonalid47": {
"email": "[email protected]",
"token": "d3f98b5a2f.7b1324c6e4.7475c89e59",
"username": "jesus.mcdonalid47",
"bio": "Web 2.0 startup names, just for the heck of it",
"image": "https://randomuser.me/api/portraits/men/92.jpg",
"following": false
},
"bender": {
"email": "[email protected]",
"token": "71b475cbc8.23152cb82e.8aef5fc03e",
"username": "bender",
"bio": "I'm sorry, guys. I never meant to hurt you. Just to destroy everything you ever believed in",
"image": "http://www.unboundworlds.com/wp-content/uploads/2012/03/bender2.jpg",
"following": false
},
"monty.python": {
"email": "[email protected]",
"token": "a347aca33d.1084fef2aa.341b81a3a6",
"username": "monty.python",
"bio": "You can't expect to wield supreme power just 'cause some watery tart threw a sword at you!",
"image": "https://images-na.ssl-images-amazon.com/images/I/710PzQnaomL._SY445_.jpg",
"following": false
}
}
64 changes: 64 additions & 0 deletions cypress/fixtures/comments.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"comments": [
{
"id": 1,
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:22:56.637Z",
"body": "Wait a minute - you've been declared dead. You can't give orders around here.",
"author": {
"username": "jake",
"bio": "I work at statefarm",
"image": "https://i.stack.imgur.com/xHWG8.jpg",
"following": false
}
},
{
"id": 2,
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:22:56.637Z",
"body": "Wait a minute - you've been declared dead. You can't give orders around here.",
"author": {
"username": "johnjacob",
"bio": "I work at statefarm",
"image": "https://i.stack.imgur.com/xHWG8.jpg",
"following": false
}
},
{
"id": 3,
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:22:56.637Z",
"body": "Besides, you look good in a dress.",
"author": {
"username": "jake",
"bio": "I work at statefarm",
"image": "https://i.stack.imgur.com/xHWG8.jpg",
"following": false
}
},
{
"id": 4,
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:22:56.637Z",
"body": "It's called 'taking advantage.' It's what gets you ahead in life. I care deeply for nature. Whoa, this guy's straight? What's Spanish for \"I know you speak English?\"",
"author": {
"username": "johnjacob",
"bio": "I work at statefarm",
"image": "https://i.stack.imgur.com/xHWG8.jpg",
"following": false
}
},
{
"id": 5,
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:22:56.637Z",
"body": "There's only one man I've ever called a coward, and that's Brian Doyle Murray. No, what I'm calling you is a television actor.\n\nBad news. Andy Griffith turned us down. He didn't like his trailer. I'm half machine. I'm a monster.",
"author": {
"username": "jake",
"bio": "I work at statefarm",
"image": "https://i.stack.imgur.com/xHWG8.jpg",
"following": false
}
}
]
}
5 changes: 5 additions & 0 deletions cypress/fixtures/profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": 8739,
"name": "Jane",
"email": "[email protected]"
}
32 changes: 32 additions & 0 deletions cypress/fixtures/profiles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"jake": {
"username": "jake",
"bio": "I work at statefarm",
"image": "https://i.stack.imgur.com/xHWG8.jpg",
"following": false
},
"nietzsche": {
"username": "nietzsche",
"bio": "Contradict strong faith victorious merciful",
"image": "http://nietzsche-ipsum.com/nietzsche.jpg",
"following": false
},
"jesus.mcdonalid47": {
"username": "jesus.mcdonalid47",
"bio": "Web 2.0 startup names, just for the heck of it",
"image": "https://randomuser.me/api/portraits/men/92.jpg",
"following": false
},
"bender": {
"username": "bender",
"bio": "I'm sorry, guys. I never meant to hurt you. Just to destroy everything you ever believed in",
"image": "http://www.unboundworlds.com/wp-content/uploads/2012/03/bender2.jpg",
"following": false
},
"monty.python": {
"username": "monty.python",
"bio": "You can't expect to wield supreme power just 'cause some watery tart threw a sword at you!",
"image": "https://images-na.ssl-images-amazon.com/images/I/710PzQnaomL._SY445_.jpg",
"following": false
}
}
17 changes: 17 additions & 0 deletions cypress/fixtures/tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"tags": [
"dragons",
"mercia",
"moral",
"morality",
"motorcycles",
"philosophy",
"planet",
"selfish",
"technobabble",
"training",
"ubermensch",
"witch",
"zarathustra"
]
}
Loading