mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
Expose a bug: wrong redirect on Post#create
1/2 cucumber tests are green. The reason why the first test does not succeed reliably is that the frontend redirects to a wrong URL after you create the post. It's the slug of the first created post. I want to be redirected to the slug of the created post. CC @appinteractive please fix
This commit is contained in:
parent
ba5159b70c
commit
a58861427b
@ -21,4 +21,4 @@ Feature: Create a post
|
||||
|
||||
Scenario: See a post on the landing page
|
||||
Given I previously created a post
|
||||
Then the post shows up on the landing page
|
||||
Then the post shows up on the landing page at position 1
|
||||
|
||||
@ -116,19 +116,20 @@ Given('I previously created a post', () => {
|
||||
})
|
||||
|
||||
When('I choose {string} as the title of the post', (title) => {
|
||||
lastPost.title = title
|
||||
cy.get('input[name="title"]').type(title)
|
||||
lastPost.title = title.replace('\n', ' ')
|
||||
cy.get('input[name="title"]').type(lastPost.title)
|
||||
})
|
||||
|
||||
When('I type in the following text:', (text) => {
|
||||
lastPost.text = text
|
||||
cy.get('.ProseMirror').type(text)
|
||||
lastPost.text = text.replace('\n', ' ')
|
||||
cy.get('.ProseMirror').type(lastPost.text)
|
||||
})
|
||||
|
||||
Then('the post shows up on the landing page', () => {
|
||||
Then('the post shows up on the landing page at position {int}', (index) => {
|
||||
cy.openPage('landing')
|
||||
cy.get('.ds-container').should('contain', lastPost.title)
|
||||
cy.get('.ds-container').should('contain', lastPost.text)
|
||||
const selector = `:nth-child(${index}) > .ds-card > .ds-card-content`
|
||||
cy.get(selector).should('contain', lastPost.title)
|
||||
cy.get(selector).should('contain', lastPost.text)
|
||||
})
|
||||
|
||||
Then('I get redirected to {string}', (route) => {
|
||||
@ -136,6 +137,6 @@ Then('I get redirected to {string}', (route) => {
|
||||
})
|
||||
|
||||
Then('the post was saved successfully', () => {
|
||||
cy.get('.post-card').should('contain', lastPost.title)
|
||||
cy.get('.post-card').should('contain', lastPost.text)
|
||||
cy.get('.ds-card-header > .ds-heading').should('contain', lastPost.title)
|
||||
cy.get('.content').should('contain', lastPost.text)
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user