1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Call query selector explicitly after change

Signed-off-by: DmitriyNoa <dmytro.zharkov@gmail.com>
This commit is contained in:
DmitriyNoa 2022-03-03 14:24:00 +01:00
parent 4b8ed2de37
commit 02e5ca4555

View File

@ -104,11 +104,11 @@ describe("<Select />", () => {
rerender(<Select value={options[1].value} onChange={onChange} options={options} />); 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} />); 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 () => { it("should unselect value if no value is passed", async () => {
@ -132,6 +132,6 @@ describe("<Select />", () => {
rerender(<Select value={null} onChange={onChange} options={options} />); rerender(<Select value={null} onChange={onChange} options={options} />);
expect(selectedValueContainer).not.toBeInTheDocument(); expect(container.querySelector(".Select__single-value")).not.toBeInTheDocument();
}); });
}); });