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

Added tests for Progress View V2 Invitation #58471

Merged
merged 8 commits into from
May 9, 2024

Conversation

kobryan0619
Copy link
Contributor

@kobryan0619 kobryan0619 commented May 8, 2024

Test following the PR for the invitation modal to V2 Progress view.

Note: eyes tests will be in future PR

Links

@kobryan0619 kobryan0619 marked this pull request as ready for review May 9, 2024 05:01
@kobryan0619 kobryan0619 changed the title added a test Added tests for Progress View V2 Invitation May 9, 2024
@@ -34,11 +34,13 @@ function InviteToV2ProgressModal({
const [invitationOpen, setInvitationOpen] = React.useState(false);

React.useEffect(() => {
const timeSinceInvitationLastDelayed = () => {
const numDaysSinceInvitationLastDelayed = () => {
const MILLISECONDS_IN_ONE_DAY = 1000 * 3600 * 24;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: move this constant outside the InviteToV2ProgressModal function (to the top of the file).

it('renders the dialog with required elements', () => {
renderDefault();

expect(screen.getByText(i18n.progressTrackingAnnouncement())).to.exist;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(screen.getByText(i18n.progressTrackingAnnouncement())).to.exist;
screen.getByText(i18n.progressTrackingAnnouncement());

getByText will throw an error if it is not found. We don't need the expect statement and in fact get a much much better error message if we omit it.
Same for a bunch below.

@kobryan0619 kobryan0619 merged commit f90aba5 into staging May 9, 2024
2 checks passed
@kobryan0619 kobryan0619 deleted the kaitie/test-v2-invite-modal branch May 9, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants