Skip to content
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

Merged
merged 6 commits into from
Dec 18, 2023
Merged

Conversation

PascalinDe
Copy link
Member

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

@PascalinDe PascalinDe self-assigned this Dec 14, 2023
Copy link
Member

@ineiti ineiti left a 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.

@@ -50,3 +51,29 @@ export async function mockProxy(page: any) {
});
});
}

export async function mockEvoting(page: any, empty: boolean = true) {
Copy link
Member

@ineiti ineiti Dec 14, 2023

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.

Copy link
Member Author

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?

Copy link
Member Author

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)

Copy link
Member

@ineiti ineiti Dec 15, 2023

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.

Copy link
Member Author

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

Copy link
Member

@ineiti ineiti left a 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!

@PascalinDe PascalinDe merged commit a5e99b6 into main Dec 18, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants