mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2025-06-16 13:46:16 +02:00
Format all files with Prettier
This commit is contained in:
@ -8,7 +8,10 @@
|
||||
import React from "react";
|
||||
|
||||
import {
|
||||
fireEvent, getByDisplayValue, getByText, render,
|
||||
fireEvent,
|
||||
getByDisplayValue,
|
||||
getByText,
|
||||
render,
|
||||
} from "customTestRender";
|
||||
|
||||
import { Select } from "../Select";
|
||||
@ -29,29 +32,24 @@ describe("<Select/>", () => {
|
||||
value="1"
|
||||
choices={TEST_CHOICES}
|
||||
helpText="Help text"
|
||||
|
||||
onChange={onChangeHandler}
|
||||
/>,
|
||||
/>
|
||||
);
|
||||
selectContainer = container;
|
||||
});
|
||||
|
||||
it("Test with snapshot.", () => {
|
||||
expect(selectContainer)
|
||||
.toMatchSnapshot();
|
||||
expect(selectContainer).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("Test onChange handling.", () => {
|
||||
const select = getByDisplayValue(selectContainer, "one");
|
||||
expect(select.value)
|
||||
.toBe("1");
|
||||
expect(select.value).toBe("1");
|
||||
fireEvent.change(select, { target: { value: "2" } });
|
||||
|
||||
const option = getByText(selectContainer, "two");
|
||||
expect(onChangeHandler)
|
||||
.toBeCalled();
|
||||
expect(onChangeHandler).toBeCalled();
|
||||
|
||||
expect(option.value)
|
||||
.toBe("2");
|
||||
expect(option.value).toBe("2");
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user