Skip to content

Commit

Permalink
removing broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wrt95 committed Feb 1, 2024
1 parent 57024ea commit 52be9de
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,6 @@ describe('ContentTab', () => {
expect(formContextProviderMock.debounceSave).toHaveBeenCalledTimes(4);
});
});

describe('when editing a component', () => {
const props = {
formId: component1IdMock,
form: { ...component1Mock, dataModelBindings: {} },
};

it('should render the component', async () => {
jest.spyOn(console, 'error').mockImplementation(); // Silence error from Select component
await render({ props });
expect(
screen.getByText(textMock('ux_editor.modal_properties_component_change_id')),
).toBeInTheDocument();
});

it('should auto-save when updating a field', async () => {
await render({ props });

const idInput = screen.getByLabelText(
textMock('ux_editor.modal_properties_component_change_id'),
);
await act(() => user.type(idInput, 'test'));

expect(formContextProviderMock.handleUpdate).toHaveBeenCalledTimes(4);
expect(formContextProviderMock.debounceSave).toHaveBeenCalledTimes(4);
});
});
});

const waitForData = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { isContainer } from '../../utils/formItemUtils';

export const Content = () => {
const { formId, form, handleUpdate, debounceSave } = useFormContext();

const editId = useSelector(getCurrentEditId);
const { t } = useTranslation();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useComponentSchemaQuery } from '../../../hooks/queries/useComponentSche
import { DataModelBindingRow } from './DataModelBindingRow';
import { EditComponentIdRow } from './EditComponentIdRow';

type PropertiesHeaderProps = {
export type PropertiesHeaderProps = {
form: FormComponent;
formId: string;
handleComponentUpdate: (component: FormComponent) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,6 @@ describe('EditFormComponent', () => {
},
});

const labels = {
'ux_editor.modal_properties_component_change_id': 'textbox',
'ux_editor.modal_properties_data_model_helper': 'combobox',
'ux_editor.modal_configure_read_only': 'checkbox',
};

const linkIcon = screen.getByText(/ux_editor.modal_properties_data_model_link/i);
await act(() => user.click(linkIcon));

Object.keys(labels).map(async (label) =>
expect(await screen.findByRole(labels[label], { name: label })),
);
expect(screen.getByRole('combobox'));
expect(screen.getByLabelText('Autocomplete (WCAG)'));
});

Expand All @@ -112,7 +99,6 @@ describe('EditFormComponent', () => {
},
});

expect(screen.getByLabelText('ux_editor.modal_properties_component_change_id'));
await waitFor(() =>
expect(screen.getByRole('combobox', { name: 'ux_editor.modal_header_type_helper' })),
);
Expand All @@ -126,7 +112,6 @@ describe('EditFormComponent', () => {
});

const labels = [
'ux_editor.modal_properties_component_change_id',
'ux_editor.modal_properties_file_upload_simple',
'ux_editor.modal_properties_file_upload_list',
'ux_editor.modal_properties_valid_file_endings_all',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import { textMock } from '../../../../../testing/mocks/i18nMock';
describe('FormComponentConfig', () => {
it('should render expected components', async () => {
render({});
expect(
screen.getByText(textMock('ux_editor.modal_properties_component_change_id')),
).toBeInTheDocument();
['title', 'description', 'help'].forEach(async (key) => {
expect(
screen.getByText(textMock(`ux_editor.modal_properties_textResourceBindings_${key}`)),
Expand Down

0 comments on commit 52be9de

Please sign in to comment.