chore: add data-testid's and some additional testing

This commit is contained in:
Stefan Benz
2024-10-30 18:50:32 +01:00
parent 9af39ac1bc
commit 9c041cc46f
22 changed files with 227 additions and 113 deletions

View File

@@ -131,6 +131,7 @@ export function RegisterFormWithoutPassword({
{...register("firstname", { required: "This field is required" })}
label="First name"
error={errors.firstname?.message as string}
data-testid="firstname-text-input"
/>
</div>
<div className="">
@@ -141,6 +142,7 @@ export function RegisterFormWithoutPassword({
{...register("lastname", { required: "This field is required" })}
label="Last name"
error={errors.lastname?.message as string}
data-testid="lastname-text-input"
/>
</div>
<div className="col-span-2">
@@ -151,6 +153,7 @@ export function RegisterFormWithoutPassword({
{...register("email", { required: "This field is required" })}
label="E-mail"
error={errors.email?.message as string}
data-testid="email-text-input"
/>
</div>
</div>
@@ -180,7 +183,7 @@ export function RegisterFormWithoutPassword({
)}
<div className="mt-8 flex w-full flex-row items-center justify-between">
<BackButton />
<BackButton data-testid="back-button" />
<Button
type="submit"
variant={ButtonVariants.Primary}
@@ -188,6 +191,7 @@ export function RegisterFormWithoutPassword({
onClick={handleSubmit((values) =>
submitAndContinue(values, selected === methods[0] ? false : true),
)}
data-testid="submit-button"
>
{loading && <Spinner className="h-5 w-5 mr-2" />}
{t("submit")}