Skip to content

Add Field unit tests, and remove snapshot tests#24706

Merged
behowell merged 3 commits intomicrosoft:masterfrom
behowell:field/unit-tests
Sep 8, 2022
Merged

Add Field unit tests, and remove snapshot tests#24706
behowell merged 3 commits intomicrosoft:masterfrom
behowell:field/unit-tests

Conversation

@behowell
Copy link
Contributor

@behowell behowell commented Sep 8, 2022

Current Behavior

There are no unit tests for Field.

New Behavior

  • Write unit tests that cover the functionality in useField
  • Remove snapshot unit tests, as there are screener tests that are more useful.
  • Move some shared conformance test boilerplate into the common isConformant for Field

Related Issue(s)

@behowell behowell self-assigned this Sep 8, 2022
@fabricteam
Copy link
Collaborator

fabricteam commented Sep 8, 2022

📊 Bundle size report

🤖 This report was generated against dd504116164f53a88c14ba932dc8d8e3f561e2b3

@behowell behowell marked this pull request as ready for review September 8, 2022 00:53
@behowell behowell requested a review from a team as a code owner September 8, 2022 00:53
@github-actions github-actions bot added this to the July Project Cycle Q3 2022 milestone Sep 8, 2022
@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 8, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9ca29bf:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented Sep 8, 2022

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: f7a7a4c28d517b09e06f4b6887959526296290d2 (build)

expect(input.getAttribute('aria-invalid')).toBeTruthy();
});

it('forwards ref to the primary slot', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should all components forward refs to the primary slot? If so, should this be part of the conformance test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this and the other prop forwarding test are already covered by the conformance tests--I'll take them out to avoid redundancy.

@behowell behowell merged commit d653291 into microsoft:master Sep 8, 2022
@behowell behowell deleted the field/unit-tests branch September 8, 2022 18:12
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Sep 9, 2022
* master: (63 commits)
  feat: add helper types to assist DOM element handling (microsoft#24722)
  applying package updates
  Textarea/hc bug (microsoft#24701)
  Fix null ref in use slider (microsoft#24728)
  Add Field unit tests, and remove snapshot tests (microsoft#24706)
  Stress Test: add build commands (microsoft#24575)
  Coachmark - useOffsetHeight should cause re-render on each set state to match v7 functionality (microsoft#24702)
  Implement screener tests for Field components (microsoft#24684)
  Update Field types to clean up react-field.api.md (microsoft#24703)
  fix(Popup): remove rotate(360deg) from PopupContent content styles (microsoft#24432)
  fix(FocusZone): should reset tabindex when focus is outside the zone with prop `shouldResetActiveElementWhenTabFromZone` (microsoft#24463)
  Fix greyed out legend key contrast ratio (microsoft#24714)
  fix: Portal compat should apply `focus-visible` ponyfill (microsoft#24712)
  Fix artifact error (microsoft#24717)
  chore(react-dialog): remove localShorthands in favor of griffel shorthands (microsoft#24715)
  Skip screener checks for draft PRs with exception of appropriately la… (microsoft#24694)
  fix: Remove provider classname from focus styles (microsoft#24710)
  feat: autocontrolled `useTable` hook (microsoft#24688)
  feat: add dialog properties to getNativeElementProps (microsoft#24698)
  Using migrate rather than upgrade term (microsoft#24695)
  ...
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.

chore: Write unit tests for Field

3 participants