-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix waitForSelector calls in create-daml-app-tests #6253
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,7 +234,9 @@ test('log in as three different users and start following each other', async () | |
|
||
// Add Party 3 as well and check both are in the list. | ||
await follow(page1, party3); | ||
await page1.waitForSelector('.test-select-following'); | ||
await page1.waitForFunction( | ||
() => document.querySelectorAll(".test-select-following").length == 2 | ||
); | ||
const followingList11 = await page1.$$eval('.test-select-following', following => following.map(e => e.innerHTML)); | ||
expect(followingList11).toHaveLength(2); | ||
expect(followingList11).toContain(party2); | ||
|
@@ -266,7 +268,9 @@ test('log in as three different users and start following each other', async () | |
await follow(page2, party3); | ||
|
||
// Check the following list is updated correctly. | ||
await page2.waitForSelector('.test-select-following'); | ||
await page2.waitForFunction( | ||
() => document.querySelectorAll(".test-select-following").length == 2 | ||
); | ||
Comment on lines
+271
to
+273
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m not following, we waited on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, nevermind, I misread the description of the issue. |
||
const followingList2 = await page2.$$eval('.test-select-following', following => following.map(e => e.innerHTML)); | ||
expect(followingList2).toHaveLength(2); | ||
expect(followingList2).toContain(party1); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this make the length check below redundant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of but it seemed reasonable to keep the assertion separate from the check for how long we wait. Otherwise this is easy to get lost during refactoring.