Skip to content

Commit

Permalink
Update webcomponents to latest (#2598)
Browse files Browse the repository at this point in the history
* update webcomponents to latest

* bumps

* fix unit tests

* fix unit tests

* potenital fix of Namespacesettings unit test

* Use chromium (#2601)

* Try using chromium

* fix local

* fix unit tests

* fix jobs test

---------

Co-authored-by: chriskari <chriskari@gmx.de>
Co-authored-by: Piotr Halama <piotr.halama@sap.com>
  • Loading branch information
3 people authored Oct 6, 2023
1 parent 4c8cb2f commit ba686c1
Show file tree
Hide file tree
Showing 9 changed files with 160 additions and 139 deletions.
218 changes: 109 additions & 109 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
"@types/jsonpath": "^0.2.0",
"@types/pluralize": "^0.0.29",
"@ui-schema/ui-schema": "^0.4.0-beta.1",
"@ui5/webcomponents": "~1.15.1",
"@ui5/webcomponents-fiori": "~1.15.1",
"@ui5/webcomponents-icons": "~1.15.1",
"@ui5/webcomponents-react": "~1.17.2",
"@ui5/webcomponents": "^1.17.2",
"@ui5/webcomponents-fiori": "^1.17.2",
"@ui5/webcomponents-icons": "^1.17.2",
"@ui5/webcomponents-react": "~1.19.0",
"buffer": "^6.0.3",
"classnames": "^2.2.6",
"copy-to-clipboard": "^3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion resources/backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
spec:
containers:
- name: backend
image: europe-docker.pkg.dev/kyma-project/dev/busola-backend:PR-2554
image: europe-docker.pkg.dev/kyma-project/dev/busola-backend:PR-2598
imagePullPolicy: Always
resources:
limits:
Expand Down
2 changes: 1 addition & 1 deletion resources/web/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: busola
image: europe-docker.pkg.dev/kyma-project/dev/busola-web:PR-2600
image: europe-docker.pkg.dev/kyma-project/dev/busola-web:PR-2598
imagePullPolicy: Always
resources:
requests:
Expand Down
17 changes: 5 additions & 12 deletions src/components/Preferences/test/NamespaceSettings.test.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import { showHiddenNamespacesState } from 'state/preferences/showHiddenNamespacesAtom';
import { render, fireEvent, waitFor } from 'testing/reactTestingUtils';
import { render } from 'testing/reactTestingUtils';
import NamespaceSettings from '../NamespaceSettings';

describe('NamespaceSettings', () => {
it('Sends custom message on toggle', async () => {
const { getByLabelText } = render(<NamespaceSettings />, {
it('Check ui5 switch checked', () => {
const { container } = render(<NamespaceSettings />, {
initializeState: snapshot =>
snapshot.set(showHiddenNamespacesState, true),
});

const toggle = getByLabelText('settings.clusters.showHiddenNamespaces');
const toggleSwitch = toggle.shadowRoot?.querySelector('[role="switch"]');
const toggle = container.querySelector('ui5-switch');

expect(toggleSwitch).toHaveAttribute('aria-checked', 'true');

if (toggleSwitch) fireEvent.click(toggleSwitch);

await waitFor(() => {
expect(toggleSwitch).toHaveAttribute('aria-checked', 'false');
});
expect(toggle).toHaveAttribute('checked', 'true');
});
});
2 changes: 1 addition & 1 deletion src/resources/Pods/PodRestarts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions src/resources/Pods/test/PodRestarts.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 27 additions & 8 deletions src/shared/components/StatusBadge/test/StatusBadge.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { StatusBadge } from 'shared/components/StatusBadge/StatusBadge';
import { render } from '@testing-library/react';
import { ThemeProvider } from '@ui5/webcomponents-react';

describe('StatusBadge', () => {
it('renders status text with proper role', () => {
const { queryByRole } = render(<StatusBadge>INITIAL</StatusBadge>);
const { queryByRole } = render(
<ThemeProvider>
<StatusBadge>INITIAL</StatusBadge>
</ThemeProvider>,
);

const status = queryByRole('status');
expect(status).toBeInTheDocument();
Expand All @@ -15,9 +20,11 @@ describe('StatusBadge', () => {
console.warn = jest.fn();

render(
<StatusBadge autoResolveType>
<small>Status</small>
</StatusBadge>,
<ThemeProvider>
<StatusBadge autoResolveType>
<small>Status</small>
</StatusBadge>
</ThemeProvider>,
);

expect(console.warn.mock.calls[0]).toMatchSnapshot();
Expand All @@ -26,7 +33,11 @@ describe('StatusBadge', () => {
it('renders status text with DEFAULT_STATUSES_PATH', () => {
const DEFAULT_STATUSES_PATH = 'common.statuses.initial';
// 'common.statuses.initial,common.statuses.initial,fallback';
const { queryByRole } = render(<StatusBadge>Initial</StatusBadge>);
const { queryByRole } = render(
<ThemeProvider>
<StatusBadge>Initial</StatusBadge>
</ThemeProvider>,
);
const status = queryByRole('status');
expect(status).toBeInTheDocument();
expect(status).toHaveTextContent(DEFAULT_STATUSES_PATH);
Expand All @@ -36,7 +47,9 @@ describe('StatusBadge', () => {
const RESOURCE_KIND = 'resource';
const RESOURCE_STATUSES_PATH = 'resource.statuses.initial';
const { queryByRole } = render(
<StatusBadge resourceKind={RESOURCE_KIND}>Initial</StatusBadge>,
<ThemeProvider>
<StatusBadge resourceKind={RESOURCE_KIND}>Initial</StatusBadge>
</ThemeProvider>,
);
const status = queryByRole('status');
expect(status).toBeInTheDocument();
Expand All @@ -45,14 +58,20 @@ describe('StatusBadge', () => {

it('renders status text without tooltip', () => {
const { getByTestId } = render(
<StatusBadge noTooltip>Initial</StatusBadge>,
<ThemeProvider>
<StatusBadge noTooltip>Initial</StatusBadge>
</ThemeProvider>,
);
const status = getByTestId('no-tooltip');
expect(status).toBeInTheDocument();
});

it('renders status text with tooltip', () => {
const { getByTestId } = render(<StatusBadge>Initial</StatusBadge>);
const { getByTestId } = render(
<ThemeProvider>
<StatusBadge>Initial</StatusBadge>
</ThemeProvider>,
);
const status = getByTestId('has-tooltip');
expect(status).toBeInTheDocument();
});
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/namespace/test-jobs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ context('Test Jobs', () => {
// status
cy.get('[role="status"]', { timeout: 75 * 1000 })
.first()
.should('have.text', 'Completed');
.contains('Completed');

// check logs
checkJobLogs({
Expand Down

0 comments on commit ba686c1

Please sign in to comment.