Update tests, start test driving new scenario

- tests had become outdated thanks to new implementation details, namely that a socialMedia node is being created and associated with a user instead of it being an attribute of the User
- scenario to ensure other user's can view my social media
This commit is contained in:
Matt Rider 2019-04-11 16:35:22 -03:00
parent edd37db8fe
commit 9bdd0742c9
3 changed files with 17 additions and 6 deletions

View File

@ -6,11 +6,15 @@ Feature: List Social Media Accounts
Background:
Given I have a user account
And I am logged in
And I am on the "settings" page
Scenario: Adding Social Media
Given I click on the "My social media" link
Given I am on the "settings" page
And I click on the "My social media" link
Then I should be on the "/settings/my-social-media" page
When I add a social media link
Then it gets saved successfully
And the new social media link shows up on the page
Scenario: Other user's viewing my Social Media
Given people visit my profile page
Then they should be able to see my social media links

View File

@ -91,6 +91,11 @@ Then('it gets saved successfully', () => {
})
Then('the new social media link shows up on the page', () => {
cy.get('a')
.contains("src='https://freeradical.zone/@mattwr18'")
cy.get('a[href="https://freeradical.zone/@mattwr18"]')
.should('have.length', 1)
})
Then('they should be able to see my social media links', () => {
cy.get('.ds-card-content')
})

View File

@ -45,7 +45,9 @@ describe('my-social-media.vue', () => {
getters = {
'auth/user': () => {
return {
socialMedia: ['']
socialMedia: [
{ id: 's1', url: 'https://freeradical.zone/@mattwr18' }
]
}
}
}