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 Fieldset component test file to new format #3435

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

adi-unni
Copy link
Contributor

What is the context of this PR?

Fixes: #156

Refactors the fieldset component test file to the new agreed format.

How to review this PR

Run tests locally and check that the messages make sense and describe what is being tested

Ask yourself....

  • Do we need any additional tests?
  • Are the tests descriptions clear?
  • Does the order of the test document make sense?
  • Is it internally consistent?
  • Is it consistent with the guidelines for test refactoring?
  • run this test command to view the test results:
  • yarn test --testNamePattern="FOR: Macro: Fieldset"
  • I have selected the correct Assignee
  • I have linked the correct Issue

@adi-unni adi-unni added the Tech improvements Tech debt, cleanup, code standardisation etc. label Nov 21, 2024
@adi-unni adi-unni self-assigned this Nov 21, 2024
Copy link

netlify bot commented Nov 21, 2024

Deploy Preview for ons-design-system-preview ready!

Name Link
🔨 Latest commit 3300a39
🔍 Latest deploy log https://app.netlify.com/sites/ons-design-system-preview/deploys/67af637bd22e4b00085e9e69
😎 Deploy Preview https://deploy-preview-3435--ons-design-system-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@rmccar rmccar changed the title Refactor Fieldset component Refactor Fieldset component test file Nov 22, 2024
@rmccar rmccar changed the title Refactor Fieldset component test file Refactor Fieldset component test file to new format Nov 22, 2024
@adi-unni adi-unni requested a review from a team as a code owner February 14, 2025 15:38
Comment on lines 9 to 18
describe('GIVEN: Params: accessibility', () => {
describe('WHEN: all necessary params are provided', () => {
const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET));

test('THEN: jest-axe checks pass', async () => {
const results = await axe($.html());
expect(results).toHaveNoViolations();
});
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just move this THEN into the "WHEN: legend is provided" test and remove all this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tech improvements Tech debt, cleanup, code standardisation etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing refactor - Fieldset
2 participants