mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
press enter shows search result page
This commit is contained in:
parent
a9b1958161
commit
08aaf9c7a6
@ -37,7 +37,7 @@ Then("I should see the following posts in the select dropdown:", table => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Then("I should see the following users in the select dropdown:", table => {
|
Then("I should see the following users in the select dropdown:", table => {
|
||||||
cy.get(".ds-heading").should("contain", "Users");
|
cy.get(".search-heading").should("contain", "Users");
|
||||||
table.hashes().forEach(({ slug }) => {
|
table.hashes().forEach(({ slug }) => {
|
||||||
cy.get(".ds-select-dropdown").should("contain", slug);
|
cy.get(".ds-select-dropdown").should("contain", slug);
|
||||||
});
|
});
|
||||||
@ -85,6 +85,26 @@ Then(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Then("I should see the search results page", () => {
|
||||||
|
cy.location("pathname").should(
|
||||||
|
"eq",
|
||||||
|
"/search/search-results"
|
||||||
|
);
|
||||||
|
cy.location("search").should(
|
||||||
|
"eq",
|
||||||
|
"?search=PR"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
Then("I should see the following posts on the search results page",
|
||||||
|
() => {
|
||||||
|
cy.get(".post-teaser").should(
|
||||||
|
"contain",
|
||||||
|
"101 Essays that will change the way you think"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
Then(
|
Then(
|
||||||
"I should not see posts without the searched-for term in the select dropdown",
|
"I should not see posts without the searched-for term in the select dropdown",
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
@ -8,7 +8,7 @@ Feature: Search
|
|||||||
And we have the following posts in our database:
|
And we have the following posts in our database:
|
||||||
| id | title | content |
|
| id | title | content |
|
||||||
| p1 | 101 Essays that will change the way you think | 101 Essays, of course (PR)! |
|
| p1 | 101 Essays that will change the way you think | 101 Essays, of course (PR)! |
|
||||||
| p2 | No searched for content | will be found in this post, I guarantee |
|
| p2 | No content | will be found in this post, I guarantee |
|
||||||
And we have the following user accounts:
|
And we have the following user accounts:
|
||||||
| slug | name | id |
|
| slug | name | id |
|
||||||
| search-for-me | Search for me | user-for-search |
|
| search-for-me | Search for me | user-for-search |
|
||||||
@ -23,10 +23,10 @@ Feature: Search
|
|||||||
| title |
|
| title |
|
||||||
| 101 Essays that will change the way you think |
|
| 101 Essays that will change the way you think |
|
||||||
|
|
||||||
Scenario: Press enter starts search
|
Scenario: Press enter opens search page
|
||||||
When I type "PR" and press Enter
|
When I type "PR" and press Enter
|
||||||
Then I should have one item in the select dropdown
|
Then I should see the search results page
|
||||||
Then I should see the following posts in the select dropdown:
|
Then I should see the following posts on the search results page
|
||||||
| title |
|
| title |
|
||||||
| 101 Essays that will change the way you think |
|
| 101 Essays that will change the way you think |
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user