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

Removed chartsV8 dependency from chartsV9 testcase files. #32869

Merged
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
456b718
Modified horizontal bar chart, line chart and legends testcases file.
v-asurse Aug 29, 2024
59b7892
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
v-asurse Aug 29, 2024
6f0a9e6
Updated the donut chart testcase and line chart testcase.
v-asurse Sep 2, 2024
6cb2a7f
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
v-asurse Sep 5, 2024
63a952d
Adding change file.
v-asurse Sep 5, 2024
6dae348
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
v-asurse Sep 6, 2024
c9edc1f
Adding the 'PopoverRTL.test.tsx' file and added accessibility test ca…
v-asurse Sep 9, 2024
ca5ebec
Modified popover test cases as per the PR 32415 comments.
v-asurse Sep 9, 2024
8b3af63
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
v-asurse Sep 10, 2024
981ce5a
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
v-asurse Sep 11, 2024
cdac874
Adding the latest changes for popover "undefined" test cases.
v-asurse Sep 12, 2024
6f0fcc7
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
v-asurse Sep 18, 2024
62ddf55
Remove chartsV8 dependency from ChartsV9 files.
v-asurse Sep 19, 2024
9412352
Modified the linechart.test.tsx file as per comments.
v-asurse Sep 19, 2024
542d400
Merge branch 'usr/atisjai/chartsV9' of https://github.com/microsoft/f…
v-asurse Sep 23, 2024
1cc2834
Removed unused code from the chartsV9 Visual Regression stories.
v-asurse Sep 24, 2024
c628ba6
Added 2 test cases for secondary y axis for vertical bar chart and li…
v-asurse Sep 25, 2024
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,16 +1,11 @@
import * as React from 'react';
import PopoverComponent from './Popover';
import { resetIds } from '../../Utilities';
import { getByClass, getById } from '../../utilities/TestUtility.test';
import { act, getByText, render, screen } from '@testing-library/react';
import { axe, toHaveNoViolations } from 'jest-axe';

expect.extend(toHaveNoViolations);

function sharedBeforeEach() {
resetIds();
}

beforeAll(() => {
// https://github.com/jsdom/jsdom/issues/3368
global.ResizeObserver = class ResizeObserver {
Expand Down Expand Up @@ -132,7 +127,6 @@ describe('Popover', () => {
});

describe('Popover - axe-core', () => {
beforeEach(sharedBeforeEach);

test('Should pass accessibility tests', async () => {
const { container } = render(<PopoverComponent isPopoverOpen={true} />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ jest.mock('react-dom');
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as React from 'react';
import { chartPointsDC, chartPointsDCElevateMinimums, pointsDC } from '../../utilities/test-data';
import { resetIds } from '../../Utilities';
import * as renderer from 'react-test-renderer';
import { mount, ReactWrapper } from 'enzyme';
import { IDonutChartProps, DonutChart } from './index';
Expand All @@ -14,10 +13,6 @@ import { act as domAct } from 'react-dom/test-utils';
// Wrapper of the DonutChart to be tested.
let wrapper: ReactWrapper<IDonutChartProps> | undefined;

function sharedBeforeEach() {
resetIds();
}

function sharedAfterEach() {
if (wrapper) {
wrapper.unmount();
Expand Down Expand Up @@ -51,7 +46,6 @@ export const noColorsChartPoints: IChartProps = {
};

describe('DonutChart snapShot testing', () => {
beforeEach(sharedBeforeEach);
it('renders DonutChart correctly', () => {
let component: any;
rendererAct(() => {
Expand Down Expand Up @@ -138,7 +132,6 @@ describe('DonutChart snapShot testing', () => {
});

describe('DonutChart - basic props', () => {
beforeEach(sharedBeforeEach);
afterEach(sharedAfterEach);

it('Should mount legend when hideLegend false ', () => {
Expand Down Expand Up @@ -194,7 +187,6 @@ describe('DonutChart - basic props', () => {
});

describe('DonutChart - mouse events', () => {
beforeEach(sharedBeforeEach);
afterEach(sharedAfterEach);

it('Should render callout correctly on mouseover', () => {
Expand Down Expand Up @@ -242,7 +234,6 @@ describe('DonutChart - mouse events', () => {
});

describe('Render empty chart aria label div when chart is empty', () => {
beforeEach(sharedBeforeEach);
it('No empty chart aria label div rendered', () => {
domAct(() => {
wrapper = mount(<DonutChart data={chartPointsDC} />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@ import '@testing-library/jest-dom';
import { chartPointsDC } from '../../utilities/test-data';
import { DonutChart } from './index';
import * as React from 'react';
import { DarkTheme } from '@fluentui/theme-samples';
import { ThemeProvider } from '@fluentui/react';
import { FluentProvider } from '@fluentui/react-provider';
import * as utils from '../../utilities/utilities';
import { resetIds } from '../../Utilities';
import { axe, toHaveNoViolations } from 'jest-axe';

expect.extend(toHaveNoViolations);

function sharedBeforeEach() {
resetIds();
}

beforeAll(() => {
// https://github.com/jsdom/jsdom/issues/3368
global.ResizeObserver = class ResizeObserver {
Expand All @@ -32,7 +26,6 @@ beforeAll(() => {

describe('Donut chart interactions', () => {
beforeEach(() => {
sharedBeforeEach();
jest.spyOn(global.Math, 'random').mockReturnValue(0.1);
});
afterEach(() => {
Expand Down Expand Up @@ -193,9 +186,9 @@ describe('Donut chart interactions', () => {
test('Should reflect theme change', () => {
// Arrange
const { container } = render(
<ThemeProvider theme={DarkTheme}>
<FluentProvider theme={{ colorNeutralBackground1: '#ccc' }}>
<DonutChart culture={window.navigator.language} data={chartPointsDC} innerRadius={55} />
</ThemeProvider>,
</FluentProvider>,
);

// Assert
Expand All @@ -204,7 +197,6 @@ describe('Donut chart interactions', () => {
});

describe('Donut Chart - axe-core', () => {
beforeEach(sharedBeforeEach);
test('Should pass accessibility tests', async () => {
const { container } = render(<DonutChart data={chartPointsDC} />);
let axeResults;
Expand Down
Loading
Loading