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

Refactor a11yAudit for auth-method list test #2520

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

cameronperera
Copy link
Collaborator

Description

This PR introduces the new changes to our a11y auditing in our acceptance tests. I have also added some documentation for future reference. Please make any recommendations if the README entry isn't clear or complete.

I kept this PR small for easy review of this new change. In the future, refactoring the whole CRUDL of a specific resource should be fine.

Screenshots (if appropriate)

How to Test

Checklist

  • I have added before and after screenshots for UI changes
  • I have added JSON response output for API changes
  • I have added steps to reproduce and test for bug fixes in the description
  • I have commented on my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@cameronperera cameronperera self-assigned this Oct 14, 2024
@cameronperera cameronperera requested a review from a team as a code owner October 14, 2024 16:58
Copy link

vercel bot commented Oct 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
boundary-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 21, 2024 10:05pm
boundary-ui-desktop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 21, 2024 10:05pm


currentSession().set('data.theme', 'dark');
await a11yAudit();
});
});

test('users can navigate to auth methods with proper authorization', async function (assert) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

None blocking comment: the group of tests which do not belong to the a11Audit aren't group by a module statement. Is this in purpose?
Following the pattern we have in the acceptance test, i.e: users list-test, auth-methods delete-test, we wrap them in a module, such as 'Acceptance | auth-methods | list'.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for pointing this out as looking at this is confusing. All the tests in this file are wrapped in a module named 'Acceptance | auth-methods | list'. What I did was add another module within that just for the a11yAudit tests. The main reason for this is we get access to all of the work done in the beforeEach. I wonder if maybe I should move the whole a11yAudit module to the bottom of the parent test module to make this less confusing?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahh gotcha. Now I see it,
So the a11yAudit block is within the Acceptance | auth-methods | list block.

Yeah, not a strong opinion which can be the best formula for that. I am fine with it 😉 and you are leading this initiative, so whatever you think is best, let's keep with it and we can review later if its a problem.

Great work!!

Copy link
Collaborator

@calcaide calcaide left a comment

Choose a reason for hiding this comment

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

Left a none blocking comment.

Thanks for the work!! 🙌

Copy link
Collaborator

@ZedLi ZedLi left a comment

Choose a reason for hiding this comment

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

Looks to me like a very reasonable refactor for getting focused tests on a11y audits. Thanks for looking into this!

});

module('a11yAudit', function () {
test.each('auth-methods', ['light', 'dark'], async function (assert, data) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Big fan of using test.each for this, I didn't realize this actually existed and wanted to parametrize some tests before and would've loved to have done this instead!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants