Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@fluentui/react-conformance

microsoft2.2kMIT0.20.1TypeScript support: included

Customizable conformance testing utility for Fluent UI React components.

readme

@fluentui/react-conformance

A tool used to run standardized tests which follow Fluent UI React's component guidelines. It also can be extended and allows for adding your own conformance tests.

Configuration

isConformant ( base configuration )

Add isConformant within your package and configure any globally applied test options.

my-proj/
├─ common/
│  ├─ isConformant.ts 👈
├─ src/
├─ node_modules/
├─ package.json
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
import type { IsConformantOptions } from '@fluentui/react-conformance';

export function isConformant<TProps = {}>(
  testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },
) {
  const defaultOptions: Partial<IsConformantOptions<TProps>> = {
    componentPath: require.main?.filename.replace('.test', ''),
    // 👆 Put any required test options here ( ex: componentPath, asPropHandlesRef, ... )
  };

  baseIsConformant(defaultOptions, testInfo);
}

isConformant ( running tests )

Within your component's test file:

my-proj/
├─ common/
├─ src/
│  ├─ components
│  │  ├─ Foo
│  │  │  ├─ ...
│  │  │  ├─ Foo.test 👈
├─ node_modules/
├─ package.json

Import the isConformant file that you just created:

import { isConformant } from '../../common/isConformant';

describe('Foo', () => {
  isConformant({
    Component: Foo,
    displayName: 'Foo',
    disabledTests: [],
    // 👆 For tests that don't fit the guidelines of your component you can disable them.
  });
});

isConformant with React Portals

By default isConformant inspects a component's immediate parent container. Because React Portals are typically rendered outside this container components using Portals will fail conformance. For example the component-has-static-classnames-object tests inspect the rendered DOM for certain class names but, with default settings, will fail for anything rendered into a Portal.

Portals can be inspected by providing a getTargetElement function to isConformant.


// Assume that `Foo` is a component that renders a Portal.
// It takes a prop called `idForPortal` that renders the
// provided id in the Portal, allowing it to be looked up
// via `getPortalElement()`.

const getPortalElement = (result, attr) => {
  return result.baseElement.querySelector("#portal-id");
};

describe('Foo', () => {
  isConformant({
    Component: Foo,
    displayName: 'Foo'
    requiredProps: { idForPortal: "portal-id" },
    getTargetElement: getPortalElement
  });
});

changelog

Change Log - @fluentui/react-conformance

This log was last generated on Tue, 04 Nov 2025 14:46:31 GMT and should not be manually modified.

0.20.1

Tue, 04 Nov 2025 14:46:31 GMT Compare changes

Patches

0.20.0

Wed, 14 May 2025 13:28:52 GMT Compare changes

Patches

0.19.3

Wed, 08 Jan 2025 18:33:33 GMT Compare changes

Patches

0.19.2

Mon, 11 Nov 2024 10:01:11 GMT Compare changes

Patches

0.19.1

Mon, 15 Jul 2024 17:25:26 GMT Compare changes

Patches

0.19.0

Tue, 20 Feb 2024 14:22:19 GMT Compare changes

Minor changes

0.18.3

Thu, 09 Nov 2023 17:29:33 GMT Compare changes

Patches

0.18.2

Tue, 26 Sep 2023 17:49:04 GMT Compare changes

Patches

0.18.1

Tue, 26 Sep 2023 15:32:03 GMT Compare changes

Patches

0.18.0

Wed, 06 Sep 2023 13:31:31 GMT Compare changes

Minor changes

0.17.2

Tue, 05 Sep 2023 13:29:19 GMT Compare changes

Patches

0.17.1

Thu, 20 Jul 2023 18:27:27 GMT Compare changes

Patches

0.17.0

Tue, 20 Jun 2023 12:38:56 GMT Compare changes

Minor changes

0.16.3

Mon, 05 Jun 2023 07:37:25 GMT Compare changes

Patches

0.16.2

Wed, 31 May 2023 07:38:39 GMT Compare changes

Patches

0.16.0

Mon, 01 May 2023 07:39:51 GMT Compare changes

Minor changes

0.15.4

Thu, 20 Oct 2022 07:43:11 GMT Compare changes

Patches

0.15.3

Wed, 24 Aug 2022 16:36:05 GMT Compare changes

Patches

0.15.2

Tue, 23 Aug 2022 07:22:48 GMT Compare changes

Patches

0.15.0

Thu, 28 Jul 2022 07:41:18 GMT Compare changes

Minor changes

0.14.0

Fri, 24 Jun 2022 07:43:32 GMT Compare changes

Minor changes

0.13.0

Tue, 29 Mar 2022 07:39:04 GMT Compare changes

Minor changes

0.12.0

Wed, 16 Mar 2022 07:38:50 GMT Compare changes

Minor changes

0.11.0

Tue, 08 Mar 2022 07:35:08 GMT Compare changes

Minor changes

0.10.1

Fri, 11 Feb 2022 07:27:48 GMT Compare changes

Patches

0.10.0

Fri, 07 Jan 2022 07:27:47 GMT Compare changes

Minor changes

0.9.2

Wed, 15 Dec 2021 07:31:28 GMT Compare changes

Patches

0.9.1

Tue, 14 Dec 2021 07:30:02 GMT Compare changes

Patches

0.9.0

Fri, 10 Dec 2021 07:30:34 GMT Compare changes

Minor changes

0.8.0

Tue, 30 Nov 2021 07:37:33 GMT Compare changes

Minor changes

0.7.2

Thu, 25 Nov 2021 14:54:15 GMT Compare changes

Patches

0.7.1

Mon, 15 Nov 2021 07:29:05 GMT Compare changes

Patches

0.7.0

Wed, 10 Nov 2021 07:31:59 GMT Compare changes

Minor changes

0.6.0

Thu, 21 Oct 2021 07:28:35 GMT Compare changes

Minor changes

0.5.1

Tue, 21 Sep 2021 07:42:34 GMT Compare changes

Patches

0.5.0

Tue, 07 Sep 2021 07:34:55 GMT Compare changes

Minor changes

0.4.5

Thu, 02 Sep 2021 07:36:46 GMT Compare changes

Patches

0.4.4

Tue, 03 Aug 2021 07:39:30 GMT Compare changes

Patches

0.4.3

Tue, 13 Jul 2021 22:32:58 GMT Compare changes

Patches

0.4.2

Fri, 09 Jul 2021 07:39:31 GMT Compare changes

Patches

0.4.1

Mon, 07 Jun 2021 07:38:15 GMT Compare changes

Patches

0.4.0

Thu, 20 May 2021 07:41:54 GMT Compare changes

Minor changes

Patches

0.3.1

Wed, 19 May 2021 07:34:20 GMT Compare changes

Patches

0.3.0

Fri, 30 Apr 2021 07:42:23 GMT Compare changes

Minor changes

Patches

0.2.6

Fri, 23 Apr 2021 07:37:10 GMT Compare changes

Patches

0.2.5

Wed, 31 Mar 2021 00:53:43 GMT Compare changes

Patches

0.2.4

Tue, 16 Mar 2021 07:32:44 GMT Compare changes

Patches

0.2.3

Fri, 12 Mar 2021 20:04:27 GMT Compare changes

Patches

0.2.2

Fri, 26 Feb 2021 01:16:27 GMT Compare changes

Patches

0.2.1

Thu, 25 Feb 2021 01:15:27 GMT Compare changes

Patches

1.0.0

Thu, 18 Feb 2021 12:27:34 GMT Compare changes

Changes