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 Test for confirm to process #269

Merged
merged 7 commits into from
Mar 5, 2024

Conversation

ChristopherPHolder
Copy link
Collaborator

@ChristopherPHolder ChristopherPHolder commented Feb 25, 2024

TL;DR;

This MR refactors the ask to skip functionality and adds proper unit test.

Description

This MR adds unit test to the askToSkip functionality while refactoring it to improve readability.

@ChristopherPHolder ChristopherPHolder changed the base branch from main to chore/improve-testing February 25, 2024 08:26

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

@Tlacenka Tlacenka left a comment

Choose a reason for hiding this comment

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

Great improvement!

Most of my comments are related to the linear flow described in the testing strategy - being able to read the test top to bottom without having to scroll up to check for additional variable values etc. I could ask myself "what process is in the mockProcess? Does the value itself matter?" and in order to find out I would have to scroll up to the setup.

In other words, repeating oneself is okay in tests. Explicit values increase the readability which is what truly matters.

ChristopherPHolder and others added 2 commits February 28, 2024 00:36
Co-authored-by: Katka Pilátová <tlacencin@gmail.com>
Co-authored-by: Katka Pilátová <tlacencin@gmail.com>

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Base automatically changed from chore/improve-testing to main February 27, 2024 23:47
@ChristopherPHolder
Copy link
Collaborator Author

Is this okey ?
Don't really know if there is a reason to create a named const for that if its not being used.

    await confirmToProcess({
      prompt: MOCK_PROMPT,
      process: jest.fn(),
    })(EMPTY_CONTEXT);   

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

@Tlacenka Tlacenka left a comment

Choose a reason for hiding this comment

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

Nice!

ad your #269 (comment)
I would personally just hardcode a short prompt message everywhere as I wouldn't mind the repetition. But if you think it doesn't look good, it is fine like this as long as it is clear that the value is static.

Copy link

github-actions bot commented Mar 5, 2024

☕ Order Coffee ☕

Date/Time: 2024-03-05 16:47

Step Name Gather Mode Performance Accessibility Best Practices Seo Pwa
🧭 Navigate to coffee cart navigation 🔒 95 97 100 85 30
☕ Select coffee timespan 11/11 - 7/7 - -
✔ Coffee selected snapshot Ø 3/3 15/16 5/5 7/9 -
🛒 Checkout order timespan 13/13 - 7/7 - -
🧾 Order checked out snapshot Ø 3/3 17/18 5/5 7/9 -
💌 Submit order timespan 13/13 - 7/7 - -
📧 Order submitted snapshot Ø 3/3 15/16 5/5 7/9 -
🧭 Navigate to github navigation 🔒 99 96 100 85 30
🔒 Budgets

🧭 Navigate to coffee cart

Resource Size Budget

Resource Type Transfer Size Over Budget
Script 162.05 KB 162.05 KB
Stylesheet 3.65 KB 3.65 KB
Image 0 Bytes -
Media 0 Bytes -
Font 0 Bytes -
Document 1.19 KB -
Other 710 Bytes -
Third-party 94.89 KB -

Resource Count Budget

Resource Type Requests Over Budget
Script 2 1 request
Stylesheet 2 1 request
Image 0 -
Media 0 -
Font 0 -
Document 1 -
Other 2 2 requests
Third-party 3 3 requests

Timing Budget

Metric Measurement Over Budget
Largest Contentful Paint 2386 ms 2376 ms
First Contentful Paint 1680 ms 1670 ms
Speed Index 1680 ms 1670 ms
Total Blocking Time 153 ms 143 ms
Cumulative Layout Shift 0.00 -

🧭 Navigate to github

Resource Size Budget

Resource Type Transfer Size Over Budget
Stylesheet 41 Bytes 41 Bytes
Script 40 Bytes 40 Bytes
Image 0 Bytes -
Media 0 Bytes -
Font 0 Bytes -
Document 1016 Bytes -
Other 0 Bytes -
Third-party 0 Bytes -

Resource Count Budget

Resource Type Requests Over Budget
Stylesheet 2 1 request
Script 2 1 request
Image 0 -
Media 0 -
Font 0 -
Document 1 -
Other 1 1 request
Third-party 3 3 requests

Timing Budget

Metric Measurement Over Budget
Largest Contentful Paint 1538 ms 1528 ms
First Contentful Paint 859 ms 849 ms
Speed Index 859 ms 849 ms
Total Blocking Time 119 ms 109 ms
Cumulative Layout Shift 0.00 -

Copy link

github-actions bot commented Mar 5, 2024

❗❗❗ report generated by this PR ❗❗❗

☕ Order Coffee ☕

Date/Time: 2024-03-05 16:48

Step Name Gather Mode Performance Accessibility Best Practices Seo Pwa
🧭 Navigate to coffee cart navigation 🔒 96 97 100 85 30
☕ Select coffee timespan 11/11 - 7/7 - -
✔ Coffee selected snapshot Ø 3/3 15/16 5/5 7/9 -
🛒 Checkout order timespan 13/13 - 7/7 - -
🧾 Order checked out snapshot Ø 3/3 17/18 5/5 7/9 -
💌 Submit order timespan 13/13 - 7/7 - -
📧 Order submitted snapshot Ø 3/3 15/16 5/5 7/9 -
🧭 Navigate to github navigation 🔒 99 96 100 85 30
🔒 Budgets

🧭 Navigate to coffee cart

Resource Size Budget

Resource Type Transfer Size Over Budget
Script 162.11 KB 162.11 KB
Stylesheet 3.64 KB 3.64 KB
Image 0 Bytes -
Media 0 Bytes -
Font 0 Bytes -
Document 1.19 KB -
Other 688 Bytes -
Third-party 94.94 KB -

Resource Count Budget

Resource Type Requests Over Budget
Script 2 1 request
Stylesheet 2 1 request
Image 0 -
Media 0 -
Font 0 -
Document 1 -
Other 2 2 requests
Third-party 3 3 requests

Timing Budget

Metric Measurement Over Budget
Largest Contentful Paint 2372 ms 2362 ms
First Contentful Paint 1674 ms 1664 ms
Speed Index 1674 ms 1664 ms
Total Blocking Time 143 ms 133 ms
Cumulative Layout Shift 0.00 -

🧭 Navigate to github

Resource Size Budget

Resource Type Transfer Size Over Budget
Script 41 Bytes 41 Bytes
Stylesheet 40 Bytes 40 Bytes
Image 0 Bytes -
Media 0 Bytes -
Font 0 Bytes -
Document 1016 Bytes -
Other 0 Bytes -
Third-party 0 Bytes -

Resource Count Budget

Resource Type Requests Over Budget
Script 2 1 request
Stylesheet 2 1 request
Image 0 -
Media 0 -
Font 0 -
Document 1 -
Other 1 1 request
Third-party 3 3 requests

Timing Budget

Metric Measurement Over Budget
Largest Contentful Paint 1541 ms 1531 ms
First Contentful Paint 857 ms 847 ms
Speed Index 857 ms 847 ms
Total Blocking Time 132 ms 122 ms
Cumulative Layout Shift 0.00 -

@ChristopherPHolder ChristopherPHolder merged commit d54c355 into main Mar 5, 2024
3 checks passed
@ChristopherPHolder ChristopherPHolder deleted the chore/improve-testing-confirm-to-process branch March 5, 2024 18:15
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.

2 participants