From 9bdd0742c9ffde68e988abbb7d3b156232b88efb Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Thu, 11 Apr 2019 16:35:22 -0300 Subject: [PATCH] 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 --- cypress/integration/SocialMedia.feature | 10 +++++++--- cypress/integration/common/settings.js | 9 +++++++-- webapp/pages/settings/my-social-media.spec.js | 4 +++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/cypress/integration/SocialMedia.feature b/cypress/integration/SocialMedia.feature index 91ee9919c..6386b94ee 100644 --- a/cypress/integration/SocialMedia.feature +++ b/cypress/integration/SocialMedia.feature @@ -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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/cypress/integration/common/settings.js b/cypress/integration/common/settings.js index d31baefce..395208b1a 100644 --- a/cypress/integration/common/settings.js +++ b/cypress/integration/common/settings.js @@ -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') + +}) \ No newline at end of file diff --git a/webapp/pages/settings/my-social-media.spec.js b/webapp/pages/settings/my-social-media.spec.js index b3e198a6f..8af15f2a8 100644 --- a/webapp/pages/settings/my-social-media.spec.js +++ b/webapp/pages/settings/my-social-media.spec.js @@ -45,7 +45,9 @@ describe('my-social-media.vue', () => { getters = { 'auth/user': () => { return { - socialMedia: [''] + socialMedia: [ + { id: 's1', url: 'https://freeradical.zone/@mattwr18' } + ] } } }