Merged in chore/fix-tests (pull request #3430)
Chore/fix tests * chore: Upgrade nextjs@16.1.1 * chore: upgrade next@16.1.1 * upgrade underlying types * merge * Fix broken tests * bump @swc/plugin-formatjs to latest version * bump sentry * transpile "import-in-the-middle" & "require-in-the-middle" * revert next@16.1.1 upgrade * revert transpilation addition * .
This commit is contained in:
@@ -71,35 +71,37 @@ describe("Input", () => {
|
||||
expect(screen.queryByLabelText("Clear content")).toBeNull()
|
||||
})
|
||||
|
||||
it("does not show clear button when input is empty", () => {
|
||||
it("does not show clear button when input is empty", async () => {
|
||||
renderInput({
|
||||
label: "Email",
|
||||
value: "",
|
||||
onChange: vi.fn(),
|
||||
showClearContentIcon: true,
|
||||
})
|
||||
|
||||
expect(await screen.findByRole("textbox")).toBeTruthy()
|
||||
expect(screen.queryByLabelText("Clear content")).toBeNull()
|
||||
})
|
||||
|
||||
it("shows clear button when input has value and showClearContentIcon is true", () => {
|
||||
it("shows clear button when input has value and showClearContentIcon is true", async () => {
|
||||
renderInput({
|
||||
label: "Email",
|
||||
value: "test",
|
||||
onChange: vi.fn(),
|
||||
showClearContentIcon: true,
|
||||
})
|
||||
expect(screen.getByLabelText("Clear content")).toBeTruthy()
|
||||
expect(await screen.findByLabelText("Clear content")).toBeTruthy()
|
||||
})
|
||||
})
|
||||
|
||||
describe("icons", () => {
|
||||
it("renders left icon when provided", () => {
|
||||
it("renders left icon when provided", async () => {
|
||||
renderInput({
|
||||
label: "Search",
|
||||
// eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
||||
leftIcon: <span data-testid="left-icon">🔍</span>,
|
||||
})
|
||||
expect(screen.getByTestId("left-icon")).toBeTruthy()
|
||||
expect(await screen.findByTestId("left-icon")).toBeTruthy()
|
||||
})
|
||||
|
||||
it("renders right icon when provided", () => {
|
||||
@@ -111,7 +113,7 @@ describe("Input", () => {
|
||||
expect(screen.getByTestId("right-icon")).toBeTruthy()
|
||||
})
|
||||
|
||||
it("hides right icon when clear button is shown", () => {
|
||||
it("hides right icon when clear button is shown", async () => {
|
||||
renderInput({
|
||||
label: "Email",
|
||||
value: "test",
|
||||
@@ -120,8 +122,8 @@ describe("Input", () => {
|
||||
// eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
||||
rightIcon: <span data-testid="right-icon">👁</span>,
|
||||
})
|
||||
expect(await screen.findByLabelText("Clear content")).toBeTruthy()
|
||||
expect(screen.queryByTestId("right-icon")).toBeNull()
|
||||
expect(screen.getByLabelText("Clear content")).toBeTruthy()
|
||||
})
|
||||
|
||||
it("shows right icon when clear button condition not met", () => {
|
||||
|
||||
Reference in New Issue
Block a user