mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
add integration test for editing social media
This commit is contained in:
parent
05b6c63006
commit
c2887c7b90
@ -79,7 +79,7 @@ Then('I should be on the {string} page', page => {
|
||||
})
|
||||
|
||||
When('I add a social media link', () => {
|
||||
cy.get("input[name='social-media']")
|
||||
cy.get('input#addSocialMedia')
|
||||
.type('https://freeradical.zone/peter-pan')
|
||||
.get('button')
|
||||
.contains('Add link')
|
||||
@ -98,7 +98,7 @@ Then('the new social media link shows up on the page', () => {
|
||||
|
||||
Given('I have added a social media link', () => {
|
||||
cy.openPage('/settings/my-social-media')
|
||||
.get("input[name='social-media']")
|
||||
.get('input#addSocialMedia')
|
||||
.type('https://freeradical.zone/peter-pan')
|
||||
.get('button')
|
||||
.contains('Add link')
|
||||
@ -121,3 +121,34 @@ Then('it gets deleted successfully', () => {
|
||||
cy.get('.iziToast-message')
|
||||
.should('contain', 'Deleted social media')
|
||||
})
|
||||
|
||||
When('I start editing a social media link', () => {
|
||||
cy.get("a[name='edit']")
|
||||
.click()
|
||||
})
|
||||
|
||||
Then('I can cancel editing', () => {
|
||||
cy.get('button#cancel')
|
||||
.click()
|
||||
.get('input#editSocialMedia')
|
||||
.should('have.length', 0)
|
||||
})
|
||||
|
||||
When('I edit and save the link', () => {
|
||||
cy.get('input#editSocialMedia')
|
||||
.clear()
|
||||
.type('https://freeradical.zone/tinkerbell')
|
||||
.get('button')
|
||||
.contains('Save')
|
||||
.click()
|
||||
})
|
||||
|
||||
Then('the new url is displayed', () => {
|
||||
cy.get("a[href='https://freeradical.zone/tinkerbell']")
|
||||
.should('have.length', 1)
|
||||
})
|
||||
|
||||
Then('the old url is not displayed', () => {
|
||||
cy.get("a[href='https://freeradical.zone/peter-pan']")
|
||||
.should('have.length', 0)
|
||||
})
|
||||
|
||||
@ -15,7 +15,7 @@ Feature: List Social Media Accounts
|
||||
Then it gets saved successfully
|
||||
And the new social media link shows up on the page
|
||||
|
||||
Scenario: Other user's viewing my Social Media
|
||||
Scenario: Other users viewing my Social Media
|
||||
Given I have added a social media link
|
||||
When people visit my profile page
|
||||
Then they should be able to see my social media links
|
||||
@ -27,3 +27,16 @@ Feature: List Social Media Accounts
|
||||
Given I have added a social media link
|
||||
When I delete a social media link
|
||||
Then it gets deleted successfully
|
||||
|
||||
Scenario: Editing Social Media
|
||||
Given I am on the "settings" page
|
||||
And I click on the "Social media" link
|
||||
Then I should be on the "/settings/my-social-media" page
|
||||
Given I have added a social media link
|
||||
When I start editing a social media link
|
||||
Then I can cancel editing
|
||||
When I start editing a social media link
|
||||
And I edit and save the link
|
||||
Then it gets saved successfully
|
||||
And the new url is displayed
|
||||
But the old url is not displayed
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user