[OTHER] <Test error for "event listed" test on the /events end point>
What would you like to share?
Error: expect(received).toBeGreaterThan(expected)
Matcher error: received value must be a number or bigint
Received has type: object
Received has value: {"_frame": {"_guid": "frame@9ba2e5f7edd95b256e626fef153667cf", "_type": "Frame"}, "_selector": "li"}
21 | test("Events listed", async ({ page }) => {
22 | await page.goto("/events");
> 23 | await expect(page.locator("li")).toBeGreaterThan(1);
| ^
24 | });
25 |
26 | test.describe("accessibility tests (light)", () => {
at /Users/jack/Documents/Dev/LinkFree/tests/events.spec.js:23:36
1 failed
[chromium] › events.spec.js:21:5 › Events listed
This error occurs because the "toBeGreaterThan" matcher expects a numeric or bigint value as the "received" parameter. However, the value passed to the expect function is an object with information about the located elements.
Additional information
No response
To reduce notifications, issues are locked until they are https://github.com/EddieHubCommunity/LinkFree/labels/%F0%9F%8F%81%20status%3A%20ready%20for%20dev and to be assigned. You can learn more in our contributing guide https://github.com/EddieHubCommunity/LinkFree/blob/main/CONTRIBUTING.md
Good spot 👍 I think because no data has been loaded yet, so we should have the automated tests add some event data
The issue has been unlocked and is now ready for dev. If you would like to work on this issue, you can comment to have it assigned to you. You can learn more in our contributing guide https://github.com/EddieHubCommunity/LinkFree/blob/main/CONTRIBUTING.md
Good spot 👍 I think because no data has been loaded yet, so we should have the automated tests add some event data
The "events" directory within "tests/data/_test-profile-user-6" includes two example json files as shown in the below screenshot. I believe they are supposed to load when the test runs. Please correct me if my assumptions are wrong.
To fix the current issue, I propose that we modify our test expectation to properly check the count of the located elements using the .count() method provided by Playwright's Locator:
test("Events listed", async ({ page }) => {
await page.goto("/events");
const elements = await page.locator("li").count();
await expect(elements).toBeGreaterThan(1);
});
Can I work on This?
Can I work on This?
@Pravesh-Sudha I have assigned this to you
@jackli921 I got a question , you mentioned in the above comment that we should use
test("Events listed", async ({ page })
but the source code include:
test.fixme("Events listed", async ({ page })
What should I use ?
@jackli921 I got a question , you mentioned in the above comment that we should use
test("Events listed", async ({ page })but the source code include:test.fixme("Events listed", async ({ page })What should I use ?
Hi Pravesh, I removed the .fixme part so that the test can run. .fixme is included, the test will skip that one. If the changes you've made works, then you can submit a pull request without the .fixme I believe. You can always confirm it with one of the maintainers.
Thanks @jackli921 for the guidance, I have submitted the PR
Great collaboration 💪