Skip to content
Snippets Groups Projects
Commit f04f99c0 authored by Henrik's avatar Henrik
Browse files

fix: unit test

parent 82958661
No related branches found
No related tags found
1 merge request!66Feat/bankid login
Pipeline #282237 passed with warnings
...@@ -89,9 +89,9 @@ const handleSubmit = async () => { ...@@ -89,9 +89,9 @@ const handleSubmit = async () => {
id="emailInput" id="emailInput"
input-id="email" input-id="email"
type="email" type="email"
label="E-postadresse" label="E-post"
placeholder="Skriv inn din e-postadresse" placeholder="Skriv inn din e-post"
invalid-message="Ugyldig e-postadresse" invalid-message="Ugyldig e-post"
/> />
<BaseInput :model-value="passwordRef" <BaseInput :model-value="passwordRef"
......
...@@ -41,8 +41,8 @@ describe('Menu and Router Tests', () => { ...@@ -41,8 +41,8 @@ describe('Menu and Router Tests', () => {
}, },
}); });
expect(wrapper.text()).toContain('email'); expect(wrapper.text()).toContain('E-post');
expect(wrapper.text()).toContain('password'); expect(wrapper.text()).toContain('Passord');
}); });
}); });
...@@ -72,8 +72,8 @@ describe('Menu and Router Tests', () => { ...@@ -72,8 +72,8 @@ describe('Menu and Router Tests', () => {
it('updates user credetials correctly', async () => { it('updates user credetials correctly', async () => {
const { getByPlaceholderText } = render(MyComponent); const { getByPlaceholderText } = render(MyComponent);
const emailInput = getByPlaceholderText('Enter your email') as HTMLInputElement; const emailInput = getByPlaceholderText('Skriv inn din e-post') as HTMLInputElement;
const passwordInput = getByPlaceholderText('Enter password') as HTMLInputElement; const passwordInput = getByPlaceholderText('Skriv inn ditt passord') as HTMLInputElement;
await fireEvent.update(emailInput, 'user@example.com'); await fireEvent.update(emailInput, 'user@example.com');
await fireEvent.update(passwordInput, 'Password1'); await fireEvent.update(passwordInput, 'Password1');
......
...@@ -99,9 +99,9 @@ const handleSubmit = async () => { ...@@ -99,9 +99,9 @@ const handleSubmit = async () => {
id="emailInput" id="emailInput"
input-id="email" input-id="email"
type="email" type="email"
label="E-postadresse" label="E-post"
placeholder="Skriv inn din e-postadresse" placeholder="Skriv inn din e-post"
invalid-message="Ugyldig e-postadresse"/> invalid-message="Ugyldig e-post"/>
</div> </div>
<div class="col-sm"> <div class="col-sm">
<BaseInput :model-value="passwordRef" <BaseInput :model-value="passwordRef"
...@@ -120,7 +120,7 @@ const handleSubmit = async () => { ...@@ -120,7 +120,7 @@ const handleSubmit = async () => {
type="password" type="password"
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,16}" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,16}"
label="Bekreft Passord" label="Bekreft Passord"
placeholder="Skriv inn passord" placeholder="Bekreft passord"
invalid-message="Passordet må være mellom 4 og 16 tegn og inneholde én stor bokstav, liten bokstav og et tall" invalid-message="Passordet må være mellom 4 og 16 tegn og inneholde én stor bokstav, liten bokstav og et tall"
/> />
</div> </div>
......
...@@ -39,9 +39,9 @@ describe('Menu and Router Tests', () => { ...@@ -39,9 +39,9 @@ describe('Menu and Router Tests', () => {
}, },
}); });
expect(wrapper.text()).toContain('First name'); expect(wrapper.text()).toContain('Fornavn');
expect(wrapper.text()).toContain('Surname'); expect(wrapper.text()).toContain('Etternavn');
expect(wrapper.text()).toContain('Email'); expect(wrapper.text()).toContain('E-post');
}); });
}); });
...@@ -71,10 +71,10 @@ describe('Menu and Router Tests', () => { ...@@ -71,10 +71,10 @@ describe('Menu and Router Tests', () => {
it('updates user credentials correctly', async () => { it('updates user credentials correctly', async () => {
const { getByPlaceholderText } = render(MyComponent); const { getByPlaceholderText } = render(MyComponent);
const firstInput = getByPlaceholderText('Enter your first name') as HTMLInputElement; const firstInput = getByPlaceholderText('Skriv inn ditt fornavn') as HTMLInputElement;
const lastInput = getByPlaceholderText('Enter your surname') as HTMLInputElement; const lastInput = getByPlaceholderText('Skriv inn ditt etternavn') as HTMLInputElement;
const emailInput = getByPlaceholderText('Enter your email') as HTMLInputElement; const emailInput = getByPlaceholderText('Skriv inn din e-post') as HTMLInputElement;
const passwordInput = getByPlaceholderText('Enter password') as HTMLInputElement; const passwordInput = getByPlaceholderText('Skriv inn passord') as HTMLInputElement;
await fireEvent.update(firstInput, 'Alice'); await fireEvent.update(firstInput, 'Alice');
await fireEvent.update(lastInput, 'Alicon'); await fireEvent.update(lastInput, 'Alicon');
...@@ -96,7 +96,7 @@ describe('Menu and Router Tests', () => { ...@@ -96,7 +96,7 @@ describe('Menu and Router Tests', () => {
}); });
const errorMsg = container.querySelector('#invalid'); // Use the actual ID here const errorMsg = container.querySelector('#invalid'); // Use the actual ID here
expect(errorMsg?.textContent === "Password must be between 4 and 16 characters and contain one capital letter, small letter and a number") expect(errorMsg?.textContent === "Passordet må være mellom 4 og 16 tegn og inneholde én stor bokstav, liten bokstav og et tall")
}); });
it('logout should have empty store at application start', () => { it('logout should have empty store at application start', () => {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="form-floating inputBox"> <div class="form-floating inputBox">
<input v-model="email" class="form-control" id="inputEmail" type="email" <input v-model="email" class="form-control" id="inputEmail" type="email"
placeholder="name@example.com" required> placeholder="name@example.com" required>
<label for="emailInput">Enter email address</label> <label for="emailInput">Skriv inn din e-post</label>
</div> </div>
<div v-if="errorMessage" class="text-danger"> <div v-if="errorMessage" class="text-danger">
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<button1 id="confirmButton" type="submit" :disabled="isSubmitting" button-text="Send e-post"></button1> <button1 id="confirmButton" type="submit" :disabled="isSubmitting" button-text="Send e-post"></button1>
<div class="login-link"> <div class="login-link">
<Router-Link to="/login" class="small">Return to login</Router-Link> <Router-Link to="/login" class="small">Gå tilbake</Router-Link>
</div> </div>
</form> </form>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment