Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
1,126 changes: 710 additions & 416 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"html-webpack-plugin": "^5.5.0",
"husky": "^9.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-environment-jsdom": "^30.2.0",
"lint-staged": "^15.2.2",
"loader-utils": "^3.2.1",
"lodash": "^4.17.23",
Expand Down
2 changes: 1 addition & 1 deletion src/checkbox/__tests__/checkbox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ test('all style api properties', () => {
expect(getComputedStyle(control).getPropertyValue(customCssProps.styleFocusRingBorderColor)).toBe('blue');
expect(getComputedStyle(control).getPropertyValue(customCssProps.styleFocusRingBorderRadius)).toBe('1px');
expect(getComputedStyle(control).getPropertyValue(customCssProps.styleFocusRingBorderWidth)).toBe('2px');
expect(getComputedStyle(label).getPropertyValue('color')).toBe('orange');
expect(getComputedStyle(label).getPropertyValue('color')).toBe('rgb(255, 165, 0)');
});

describe('native attributes', () => {
Expand Down
22 changes: 4 additions & 18 deletions src/error-boundary/__tests__/error-boundary.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -612,34 +612,20 @@
});

describe('default behaviors', () => {
let originalLocation: PropertyDescriptor | undefined;

beforeEach(() => {
originalLocation = Object.getOwnPropertyDescriptor(window, 'location');
});

afterEach(() => {
if (originalLocation) {
Object.defineProperty(window, 'location', originalLocation);
}
});

test('window reload is called when the refresh action is clicked', () => {
const mockReload = jest.fn();
Object.defineProperty(window, 'location', { configurable: true, value: { reload: mockReload } });
Object.defineProperty(window.location, 'reload', { configurable: true, writable: true, value: mockReload });

Check failure on line 617 in src/error-boundary/__tests__/error-boundary.test.tsx

View workflow job for this annotation

GitHub Actions / build (React 18) / build

default behaviors › window reload is called when the refresh action is clicked

TypeError: Cannot redefine property: reload at Function.defineProperty (<anonymous>) at Object.<anonymous> (src/error-boundary/__tests__/error-boundary.test.tsx:617:12)

Check failure on line 617 in src/error-boundary/__tests__/error-boundary.test.tsx

View workflow job for this annotation

GitHub Actions / build / build

default behaviors › window reload is called when the refresh action is clicked

TypeError: Cannot redefine property: reload at Function.defineProperty (<anonymous>) at Object.<anonymous> (src/error-boundary/__tests__/error-boundary.test.tsx:617:12)

Check failure on line 617 in src/error-boundary/__tests__/error-boundary.test.tsx

View workflow job for this annotation

GitHub Actions / dry-run / Components unit tests

default behaviors › window reload is called when the refresh action is clicked

TypeError: Cannot redefine property: reload at Function.defineProperty (<anonymous>) at Object.<anonymous> (src/error-boundary/__tests__/error-boundary.test.tsx:617:12)

renderWithErrorBoundary(<b>{{}}</b>);
findRefreshAction()!.click();
expect(mockReload).toHaveBeenCalledTimes(1);
});

test('hides default refresh in cross-origin iframes', () => {
Object.defineProperty(window, 'location', {
Object.defineProperty(window.location, 'href', {

Check failure on line 625 in src/error-boundary/__tests__/error-boundary.test.tsx

View workflow job for this annotation

GitHub Actions / build (React 18) / build

default behaviors › hides default refresh in cross-origin iframes

TypeError: Cannot redefine property: href at Function.defineProperty (<anonymous>) at Object.<anonymous> (src/error-boundary/__tests__/error-boundary.test.tsx:625:12)

Check failure on line 625 in src/error-boundary/__tests__/error-boundary.test.tsx

View workflow job for this annotation

GitHub Actions / build / build

default behaviors › hides default refresh in cross-origin iframes

TypeError: Cannot redefine property: href at Function.defineProperty (<anonymous>) at Object.<anonymous> (src/error-boundary/__tests__/error-boundary.test.tsx:625:12)

Check failure on line 625 in src/error-boundary/__tests__/error-boundary.test.tsx

View workflow job for this annotation

GitHub Actions / dry-run / Components unit tests

default behaviors › hides default refresh in cross-origin iframes

TypeError: Cannot redefine property: href at Function.defineProperty (<anonymous>) at Object.<anonymous> (src/error-boundary/__tests__/error-boundary.test.tsx:625:12)
configurable: true,
value: {
get href() {
throw new Error();
},
get() {
throw new Error();
},
});

Expand Down
2 changes: 1 addition & 1 deletion src/flashbar/__tests__/collapsible.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ describe('Collapsible Flashbar', () => {
});

expect(getComputedStyle(flashbar.findItems()[0].find('li > div')?.getElement() as HTMLElement).background).toBe(
'yellow'
'rgb(255, 255, 0)'
);

findNotificationBar(flashbar)!.click();
Expand Down
2 changes: 1 addition & 1 deletion src/pie-chart/__tests__/pie-chart.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ describe('Details popover', () => {
const { wrapper } = renderPieChart(<PieChart data={defaultData} />);
wrapper.findApplication()!.focus();
expect(wrapper.findDetailPopover()).toBeTruthy();
wrapper.findApplication()!.blur();
fireEvent.blur(wrapper.findApplication()!.getElement(), { relatedTarget: document.body });
expect(wrapper.findDetailPopover()).toBeNull();
});

Expand Down
8 changes: 4 additions & 4 deletions src/radio-button/__tests__/radio-button.core.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ test('style API', () => {
const outerCircle = wrapper.findByClassName(styles['styled-circle-border'])!.getElement();
const innerCircle = wrapper.findByClassName(styles['styled-circle-fill'])!.getElement();

expect(getComputedStyle(outerCircle).getPropertyValue('fill')).toBe('blue');
expect(getComputedStyle(outerCircle).getPropertyValue('stroke')).toBe('green');
expect(getComputedStyle(innerCircle).getPropertyValue('stroke')).toBe('blue');
expect(getComputedStyle(outerCircle).getPropertyValue('fill')).toBe('rgb(0, 0, 255)');
expect(getComputedStyle(outerCircle).getPropertyValue('stroke')).toBe('rgb(0, 128, 0)');
expect(getComputedStyle(innerCircle).getPropertyValue('stroke')).toBe('rgb(0, 0, 255)');
expect(getComputedStyle(control).getPropertyValue(customCssProps.styleFocusRingBorderColor)).toBe('orange');
expect(getComputedStyle(control).getPropertyValue(customCssProps.styleFocusRingBorderRadius)).toBe('2px');
expect(getComputedStyle(control).getPropertyValue(customCssProps.styleFocusRingBorderWidth)).toBe('1px');
expect(getComputedStyle(label).getPropertyValue('color')).toBe('brown');
expect(getComputedStyle(label).getPropertyValue('color')).toBe('rgb(165, 42, 42)');
});
4 changes: 2 additions & 2 deletions src/radio-group/__tests__/radio-group.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ test('all style api properties', function () {
expect(getComputedStyle(outerCircle).getPropertyValue('fill')).toBe('blue');
expect(getComputedStyle(outerCircle).getPropertyValue('stroke')).toBe('green');
expect(getComputedStyle(innerCircle).getPropertyValue('stroke')).toBe('blue');
expect(getComputedStyle(label).getPropertyValue('color')).toBe('brown');
expect(getComputedStyle(description).getPropertyValue('color')).toBe('yellow');
expect(getComputedStyle(label).getPropertyValue('color')).toBe('rgb(165, 42, 42)');
expect(getComputedStyle(description).getPropertyValue('color')).toBe('rgb(255, 255, 0)');
expect(getComputedStyle(control).getPropertyValue(customCssProps.styleFocusRingBorderColor)).toBe('orange');
expect(getComputedStyle(control).getPropertyValue(customCssProps.styleFocusRingBorderRadius)).toBe('2px');
expect(getComputedStyle(control).getPropertyValue(customCssProps.styleFocusRingBorderWidth)).toBe('1px');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class VisibleContentPreferenceWrapper extends ComponentWrapper {
*/
findToggleByIndex(groupIndex: number, optionIndex: number): ToggleWrapper | null {
const groupSelector = `.${getClassName('groups')} > *:nth-child(${groupIndex})`;
const optionSelector = `.${getClassName('option')}:nth-child(${optionIndex})`;
const optionSelector = `*:nth-child(${optionIndex}).${getClassName('option')}`;
return this.findComponent(`${groupSelector} ${optionSelector} .${getClassName('toggle')}`, ToggleWrapper);
}
}
6 changes: 3 additions & 3 deletions src/toggle/__tests__/toggle.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ test('all style api properties', () => {
const toggleHandle = wrapper.findByClassName(styles['toggle-handle'])!.getElement();
const toggleLabel = wrapper.findByClassName(abstractSwitchStyles.label)!.getElement();

expect(getComputedStyle(toggleControl).getPropertyValue('background-color')).toBe('green');
expect(getComputedStyle(toggleControl).getPropertyValue('background-color')).toBe('rgb(0, 128, 0)');
expect(getComputedStyle(toggleControl).getPropertyValue(customCssProps.styleFocusRingBorderColor)).toBe('magenta');
expect(getComputedStyle(toggleControl).getPropertyValue(customCssProps.styleFocusRingBorderRadius)).toBe('10px');
expect(getComputedStyle(toggleControl).getPropertyValue(customCssProps.styleFocusRingBorderWidth)).toBe('5px');
expect(getComputedStyle(toggleHandle).getPropertyValue('background-color')).toBe('blue');
expect(getComputedStyle(toggleLabel).getPropertyValue('color')).toBe('orange');
expect(getComputedStyle(toggleHandle).getPropertyValue('background-color')).toBe('rgb(0, 0, 255)');
expect(getComputedStyle(toggleLabel).getPropertyValue('color')).toBe('rgb(255, 165, 0)');
});

describe('native attributes', () => {
Expand Down
Loading