Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Fixed some adding post UI tests

Matt Roberts6c720f7882f0
diff --git a/e2e/step_definitions/show_post.steps.ts b/e2e/step_definitions/show_post.steps.ts
index 2d4c7cd52..7998b4b9a 100644
--- a/e2e/step_definitions/show_post.steps.ts
+++ b/e2e/step_definitions/show_post.steps.ts
@@ -1,6 +1,6 @@
import { Then } from "@cucumber/cucumber"
import { FiderWorld } from "../world"
-import expect from "expect"
+import { expect } from "@playwright/test"
Then("I should be on the show post page", async function (this: FiderWorld) {
const container = await this.page.$$("#p-show-post")
@@ -13,6 +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) {
- const postVoteCount = await this.page.innerText("#p-show-post .c-vote-counter__button")
- expect(postVoteCount).toBe(voteCount.toString())
+ await expect(this.page.getByText(`${voteCount} votes`, { exact: true })).toBeVisible()
})