-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from jesusantguerrero/release/1.3.0
Release/1.3.10
- Loading branch information
Showing
15 changed files
with
11,988 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
import userEvent from "@testing-library/user-event"; | ||
import { render, screen, fireEvent } from "@testing-library/vue"; | ||
import { describe, expect, it } from "vitest"; | ||
import { reactive } from "vue"; | ||
import { reactive, ref } from "vue"; | ||
import AuthForm from "./AtAuthForm.vue"; | ||
|
||
describe("AuthForm component", () => { | ||
|
@@ -92,9 +92,57 @@ describe("AuthForm component", () => { | |
}); | ||
}); | ||
|
||
it("Should render the component register", async () => { | ||
it("Should change email on initial value change", async () => { | ||
const initialValues = ref({ | ||
email: "", | ||
}); | ||
|
||
const email = "[email protected]"; | ||
|
||
const component = render(AuthForm, { | ||
props: { | ||
mode: "register", | ||
initialValues: initialValues, | ||
config: { | ||
email: { | ||
disabled: true | ||
} | ||
} | ||
}, | ||
}); | ||
|
||
initialValues.value.email = email; | ||
const inputEmail = await component.findByTestId("input-email"); | ||
expect(inputEmail.value).toBe(email); | ||
}); | ||
it("Should disable email on config set", async () => { | ||
const initialValues = ref({ | ||
email: "", | ||
}); | ||
|
||
const email = "[email protected]"; | ||
|
||
const component = render(AuthForm, { | ||
props: { | ||
mode: "register", | ||
initialValues: initialValues, | ||
config: { | ||
email: { | ||
disabled: true | ||
} | ||
} | ||
}, | ||
}); | ||
|
||
initialValues.value.email = email; | ||
const inputEmail = await component.findByTestId("input-email"); | ||
await userEvent.type(inputEmail, "[email protected]") | ||
expect(inputEmail.value).toBe(email); | ||
}); | ||
|
||
it("Should disable email after initialization in register", async () => { | ||
const initialValues = reactive({ | ||
email: "[email protected]", | ||
email: "", | ||
}); | ||
|
||
const component = render(AuthForm, { | ||
|
@@ -103,6 +151,8 @@ describe("AuthForm component", () => { | |
}, | ||
}); | ||
|
||
initialValues.email = "[email protected]" | ||
|
||
component.findByText("[email protected]"); | ||
initialValues.email = "[email protected]"; | ||
component.findByText("[email protected]"); | ||
|
Oops, something went wrong.