-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add some tests for formIndex route and remove HAR files #77
Conversation
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.
Please adjust the types of page
in the mock-methods. I just learnt that the linter/compiler doesn't complain about any
by design. But all the doc says that you shouldn't use any
.
web/frontend/tests/mocks.ts
Outdated
@@ -50,3 +51,29 @@ export async function mockProxy(page: any) { | |||
}); | |||
}); | |||
} | |||
|
|||
export async function mockEvoting(page: any, empty: boolean = true) { |
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.
IIRC, this is of type Page
.
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.
OK, I think I misunderstood Typescript, I thought there'd be only type annotations possible if there is a @types
package?
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.
Tip
oh, that's nice!
(need a place to test)
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.
Note
@types
https://github.com/DefinitelyTyped/DefinitelyTyped is definitely one of TypeScript's greatest strengths. The community has effectively gone ahead and documented the nature of nearly 90% of the top JavaScript projects out there.
So it's only needed for existing javascript projects which don't have an official types entry. For typescript projects, like playwright
, it's not needed.
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.
thanks for the link! I updated the types
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.
So beautiful - no any
!
This adds some initial tests for formIndex route and more importantly removes the HAR files in the mocks to rely on simplified JSON files instead