Call query selector explicitly after change

Signed-off-by: DmitriyNoa <dmytro.zharkov@gmail.com>
This commit is contained in:
DmitriyNoa committed 2022-03-03 14:40:53 +01:00
1 parent 4b8ed2de37
commit 02e5ca4555
1 file changed
+3 -3
@@ -104,11 +104,11 @@ describe("<Select />", () => {
rerender(<Select value={options[1].value} onChange={onChange} options={options} />);
expect(selectedValueContainer.textContent).toBe(options[1].label);
expect(container.querySelector(".Select__single-value").textContent).toBe(options[1].label);
rerender(<Select value={null} onChange={onChange} options={options} />);
expect(selectedValueContainer).not.toBeInTheDocument();
expect(container.querySelector(".Select__single-value")).not.toBeInTheDocument();
});
it("should unselect value if no value is passed", async () => {
@@ -132,6 +132,6 @@ describe("<Select />", () => {
rerender(<Select value={null} onChange={onChange} options={options} />);
expect(selectedValueContainer).not.toBeInTheDocument();
expect(container.querySelector(".Select__single-value")).not.toBeInTheDocument();
});
});