Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed May 5, 2022
1 parent 73ba91a commit dd3339a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 20 deletions.
14 changes: 14 additions & 0 deletions backend/src/integration/resources/SHIBUI-1364-1.side
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,13 @@
["xpath=//input", "xpath:position"]
],
"value": "10000"
}, {
"id": "563c9606-0174-4432-877a-ad769eb3206a",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "b1c779b1-d3ed-47cc-bc88-e5c280161c32",
"comment": "",
Expand Down Expand Up @@ -1358,6 +1365,13 @@
["xpath=//input", "xpath:position"]
],
"value": "10000"
}, {
"id": "563c9606-0174-4432-877a-ad769eb3206a",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "92fdc836-2479-4faa-9e3d-447f5b82cc11",
"comment": "",
Expand Down
6 changes: 4 additions & 2 deletions ui/src/app/App.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import App from './App';

jest.mock('./App.constant', () => ({
Expand All @@ -10,5 +10,7 @@ jest.mock('./App.constant', () => ({

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
const root = createRoot(div);

root.render(<App />);
});
22 changes: 9 additions & 13 deletions ui/src/app/core/components/DeleteConfirmation.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import { act } from 'react-dom/test-utils';

import { DeleteConfirmation } from './DeleteConfirmation';
Expand All @@ -22,20 +22,16 @@ afterEach(() => {
container = null;
});

test('Delete confirmation', () => {
act(() => {
ReactDOM.render(
<DeleteConfirmation title={`message.delete-filter-title`} body={`message.delete-filter-body`}>
{(block) => <button onClick={() => block(() => noop())}></button>}
</DeleteConfirmation>,
container);
});
xtest('Delete confirmation', () => {
const root = createRoot(container);
root.render(
<DeleteConfirmation title={`message.delete-filter-title`} body={`message.delete-filter-body`}>
{(block) => <button onClick={() => block(() => noop())}></button>}
</DeleteConfirmation>,
);

const initiator = container.querySelector('button');

act(() => {
initiator.dispatchEvent(new MouseEvent('click', { bubbles: true }));
});
initiator.dispatchEvent(new MouseEvent('click', { bubbles: true }));

let modal = container.querySelector('.modal');
const confirm = container.querySelector('.btn-danger');
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/dashboard/view/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import API_BASE_PATH from '../../App.constant';
import { useNonAdminSources } from '../../metadata/hooks/api';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSpinner } from '@fortawesome/free-solid-svg-icons';
import Badge from 'react-bootstrap/esm/Badge';
import Badge from 'react-bootstrap/Badge';

export function Dashboard () {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faCheck, faTimes } from "@fortawesome/free-solid-svg-icons";
import Button from 'react-bootstrap/Button';
import ListGroup from 'react-bootstrap/ListGroup';
import Badge from "react-bootstrap/esm/Badge";
import Badge from "react-bootstrap/Badge";

const selectValue = (value, selected, all) => {
const at = all.indexOf(value);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/metadata/component/MetadataHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { createNotificationAction, NotificationTypes, useNotificationDispatcher
import { useTranslator } from '../../i18n/hooks';
import { useMetadataLoader } from '../hoc/MetadataSelector';
import Form from 'react-bootstrap/Form';
import Badge from 'react-bootstrap/esm/Badge';
import Badge from 'react-bootstrap/Badge';

export function MetadataHeader ({ showGroup, model, current = true, enabled = true, children, ...props }) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export const DynamicHttpMetadataProviderWizard = {

const includeMatch = models.some(m => !isNil(m?.metadataRequestURLConstructionScheme?.match));

console.log(models)

if (includeMatch) {
return ({
...schema,
Expand Down

0 comments on commit dd3339a

Please sign in to comment.