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

chore: remove enzyme tests #3848

Merged
merged 7 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
import * as React from 'react';
import { ComponentName } from '../ComponentName';
import * as renderer from 'react-test-renderer';
import { checkRenderConsistency, checkReRender } from '@fluentui-react-native/test-tools';

describe('ComponentName component tests', () => {
it('ComponentName default', () => {
const tree = renderer.create(<ComponentName>Your component</ComponentName>).toJSON();
expect(tree).toMatchSnapshot();
});

it('ComponentName simple rendering does not invalidate styling', () => {
checkRenderConsistency(() => <ComponentName>Default ComponentName</ComponentName>, 2);
});

it('ComponentName re-renders correctly', () => {
checkReRender(() => <ComponentName>Render twice</ComponentName>, 2);
});

// Feel free to add more tests here
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui/react-native",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/badge",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/button",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/checkbox",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/chip",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/divider",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/experimental-shadow",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/framework",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/icon",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/input",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/interactive-hooks",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/link",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/menu",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/notification",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/overflow",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/radio-group",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/switch",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/tablist",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/text",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/tooltip",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/use-slot",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/use-slots",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/use-styling",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove enzyme tests",
"packageName": "@fluentui-react-native/use-tokens",
"email": "[email protected]",
"dependentChangeType": "patch"
}
9 changes: 0 additions & 9 deletions packages/components/Badge/src/__tests__/Badge.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';

import { checkRenderConsistency, checkReRender } from '@fluentui-react-native/test-tools';
import * as renderer from 'react-test-renderer';

import { Badge, CounterBadge, PresenceBadge } from '../';
Expand Down Expand Up @@ -44,14 +43,6 @@ describe('Badge component tests', () => {
const tree = renderer.create(<BadgeWithShadow appearance="filled">Badge with shadow</BadgeWithShadow>).toJSON();
expect(tree).toMatchSnapshot();
});

it('Check checkRenderConsistency for Badge', () => {
checkRenderConsistency(() => <Badge />, 2);
});

it('Badge re-renders correctly', () => {
checkReRender(() => <Badge />, 2);
});
});

describe('PresenceBadge component tests', () => {
Expand Down
19 changes: 0 additions & 19 deletions packages/components/Button/src/Button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from 'react';
import { Pressable, Text } from 'react-native';

import { Icon } from '@fluentui-react-native/icon';
import { checkRenderConsistency, checkReRender } from '@fluentui-react-native/test-tools';
import * as renderer from 'react-test-renderer';

import { Button } from './Button';
Expand Down Expand Up @@ -65,22 +64,4 @@ describe('Button component tests', () => {
const tree = renderer.create(<ComposedButton>Composed Button with RNText</ComposedButton>).toJSON();
expect(tree).toMatchSnapshot();
});

it('Button simple rendering does not invalidate styling', () => {
checkRenderConsistency(() => <Button>Default button</Button>, 2);
});

it('Button re-renders correctly', () => {
checkReRender(() => <Button>Render twice</Button>, 2);
});

it('Button shares produced styles across multiple renders', () => {
const style = { backgroundColor: 'black' };
checkRenderConsistency(() => <Button style={style}>Shared styles</Button>, 2);
});

it('Button re-renders correctly with style', () => {
const style = { borderColor: 'blue' };
checkReRender(() => <Button style={style}>Shared Style Render</Button>, 2);
});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';

import { checkRenderConsistency, checkReRender } from '@fluentui-react-native/test-tools';
import * as renderer from 'react-test-renderer';

import { CompoundButton } from './CompoundButton';
Expand All @@ -9,21 +8,3 @@ it('CompoundButton default', () => {
const tree = renderer.create(<CompoundButton secondaryContent="sublabel">Default Button</CompoundButton>).toJSON();
expect(tree).toMatchSnapshot();
});

it('Button simple rendering does not invalidate styling', () => {
checkRenderConsistency(() => <CompoundButton>Default button</CompoundButton>, 2);
});

it('Button re-renders correctly', () => {
checkReRender(() => <CompoundButton>Render twice</CompoundButton>, 2);
});

it('Button shares produced styles across multiple renders', () => {
const style = { backgroundColor: 'black' };
checkRenderConsistency(() => <CompoundButton style={style}>Shared styles</CompoundButton>, 2);
});

it('Button re-renders correctly with style', () => {
const style = { borderColor: 'blue' };
checkReRender(() => <CompoundButton style={style}>Shared Style Render</CompoundButton>, 2);
});
33 changes: 0 additions & 33 deletions packages/components/Button/src/FAB/FAB.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';

import { checkRenderConsistency, checkReRender } from '@fluentui-react-native/test-tools';
import * as renderer from 'react-test-renderer';

import { FAB } from './FAB';
Expand Down Expand Up @@ -30,38 +29,6 @@ it('Custom FAB with no shadow(iOS)', () => {
expect(tree).toMatchSnapshot();
});

it('Button simple rendering does not invalidate styling', () => {
checkRenderConsistency(() => <FAB icon={iconProps}>Default FAB</FAB>, 2);
});

it('FAB re-renders correctly', () => {
checkReRender(() => <FAB icon={iconProps}>Render twice</FAB>, 2);
});

it('FAB shares produced styles across multiple renders', () => {
const style = { backgroundColor: 'black' };
checkRenderConsistency(
() => (
<FAB icon={iconProps} style={style}>
Shared styles
</FAB>
),
2,
);
});

it('FAB re-renders correctly with style', () => {
const style = { borderColor: 'blue' };
checkReRender(
() => (
<FAB icon={iconProps} style={style}>
Shared Style Render
</FAB>
),
2,
);
});

afterAll(() => {
jest.unmock('react-native/Libraries/Utilities/Platform');
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';

import { checkRenderConsistency, checkReRender } from '@fluentui-react-native/test-tools';
import * as renderer from 'react-test-renderer';

import { ToggleButton } from './ToggleButton';
Expand All @@ -9,21 +8,3 @@ it('ToggleButton default', () => {
const tree = renderer.create(<ToggleButton>Default Button</ToggleButton>).toJSON();
expect(tree).toMatchSnapshot();
});

it('Button simple rendering does not invalidate styling', () => {
checkRenderConsistency(() => <ToggleButton>Default button</ToggleButton>, 2);
});

it('Button re-renders correctly', () => {
checkReRender(() => <ToggleButton>Render twice</ToggleButton>, 2);
});

it('Button shares produced styles across multiple renders', () => {
const style = { backgroundColor: 'black' };
checkRenderConsistency(() => <ToggleButton style={style}>Shared styles</ToggleButton>, 2);
});

it('Button re-renders correctly with style', () => {
const style = { borderColor: 'blue' };
checkReRender(() => <ToggleButton style={style}>Shared Style Render</ToggleButton>, 2);
});
Loading
Loading