Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Fixes #12456 : Migrate 'components/widgets/settings' module and associated tests to TypeScript #4061

Merged
merged 14 commits into from
Nov 11, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
removed reduntant test at components/widgets/settings/text_settings, …
…since TSC will not allow any other value to be passed to type prop other than given string literals
  • Loading branch information
M-ZubairAhmed committed Oct 29, 2019
commit 374c9303bb6e39c37504900ef71ffaa1c8e90be4
39 changes: 0 additions & 39 deletions components/widgets/settings/text_setting.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,45 +66,6 @@ describe('components/widgets/settings/TextSetting', () => {
`);
});

// This test is disabled as TSC will not allow to pass any other value to `type`
/*
test('render with bad type', () => {
const originalError = console.error;
console.error = jest.fn();

const wrapper = shallow(
<TextSetting
id='string.id'
label='some label'
value='some value'
type='junk'
/>
);

expect(console.error).toBeCalledTimes(1);

console.error = originalError;

expect(wrapper).toMatchInlineSnapshot(`
<Setting
inputClassName=""
inputId="string.id"
label="some label"
labelClassName=""
>
<input
className="form-control"
id="string.id"
maxLength={null}
onChange={[Function]}
type="input"
value="some value"
/>
</Setting>
`);
});
*/

test('onChange', () => {
const onChange = jest.fn();
const wrapper = shallow(
Expand Down