Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Fixed the UI test

Matt Roberts68fd543ab0be
diff --git a/e2e/features/ui/post.feature b/e2e/features/ui/post.feature
index db9ed468b..ba0d12d8b 100644
--- a/e2e/features/ui/post.feature
+++ b/e2e/features/ui/post.feature
@@ -8,7 +8,7 @@ Feature: Post
And I click submit new post
Then I should be on the show post page
And I should see "Feature Request Example" as the post title
- And I should see 1 vote
+ And I should see 1 vote(s)
Scenario: Non-logged in user can view a post
Given I go to the home page
@@ -16,4 +16,4 @@ Feature: Post
And I click on the first post
Then I should be on the show post page
And I should see "Feature Request Example" as the post title
- And I should see 1 vote
\ No newline at end of file
+ And I should see 1 vote(s)
\ No newline at end of file
diff --git a/e2e/step_definitions/show_post.steps.ts b/e2e/step_definitions/show_post.steps.ts
index 7998b4b9a..78d2b0937 100644
--- a/e2e/step_definitions/show_post.steps.ts
+++ b/e2e/step_definitions/show_post.steps.ts
@@ -13,5 +13,5 @@ Then("I should see {string} as the post title", async function (this: FiderWorld
})
Then("I should see {int} vote\\(s)", async function (this: FiderWorld, voteCount: number) {
- await expect(this.page.getByText(`${voteCount} votes`, { exact: true })).toBeVisible()
+ await expect(this.page.getByText(`${voteCount}${voteCount === 1 ? "Vote" : "Votes"}`, { exact: true })).toBeVisible()
})