Skip to content
Snippets Groups Projects
Commit 7a5971c8 authored by Ina Martini's avatar Ina Martini
Browse files

chore: run format check

parent aeeb1ab8
Branches enhancement/47/general-cleanup
No related tags found
3 merge requests!66Final merge,!57General cleanup of application,!4Pipeline fix
Pipeline #284807 passed with stages
in 5 minutes and 12 seconds
......@@ -12,8 +12,7 @@ const confirm = ref<string>('')
const showPassword = ref<boolean>(false)
const errorMessage = ref<string>('')
const passwordValidations = ref<string[]>([]);
const passwordValidations = ref<string[]>([])
const userStore = useUserStore()
......@@ -45,37 +44,37 @@ const toggleShowPassword = () => {
}
const validatePassword = () => {
const messages = [];
const lengthValid = password.value.length >= 8 && password.value.length <= 30;
const numberValid = /[0-9]/.test(password.value);
const lowercaseValid = /[a-zæøå]/.test(password.value);
const uppercaseValid = /[ÆØÅA-Z]/.test(password.value);
const specialCharacterValid = /[@#$%^&+=!]/.test(password.value);
const noSpacesValid = !/\s/.test(password.value);
const messages = []
const lengthValid = password.value.length >= 8 && password.value.length <= 30
const numberValid = /[0-9]/.test(password.value)
const lowercaseValid = /[a-zæøå]/.test(password.value)
const uppercaseValid = /[ÆØÅA-Z]/.test(password.value)
const specialCharacterValid = /[@#$%^&+=!]/.test(password.value)
const noSpacesValid = !/\s/.test(password.value)
if (!lengthValid) {
messages.push('Må være mellom 8 og 30 karakterer. ');
}
if (!numberValid) {
messages.push('Må inneholde minst ett tall. ');
}
if (!lowercaseValid) {
messages.push('Må inneholde minst én liten bokstav. ');
}
if (!uppercaseValid) {
messages.push('Må inneholde minst én stor bokstav. ');
}
if (!specialCharacterValid) {
messages.push('Må inneholde minst ett spesialtegn (@#$%^&+=!). ');
}
if (!noSpacesValid) {
messages.push('Må ikke inneholde mellomrom. ');
}
if (!lengthValid) {
messages.push('Må være mellom 8 og 30 karakterer. ')
}
if (!numberValid) {
messages.push('Må inneholde minst ett tall. ')
}
if (!lowercaseValid) {
messages.push('Må inneholde minst én liten bokstav. ')
}
if (!uppercaseValid) {
messages.push('Må inneholde minst én stor bokstav. ')
}
if (!specialCharacterValid) {
messages.push('Må inneholde minst ett spesialtegn (@#$%^&+=!). ')
}
if (!noSpacesValid) {
messages.push('Må ikke inneholde mellomrom. ')
}
passwordValidations.value = messages;
};
passwordValidations.value = messages
}
watch(password, validatePassword);
watch(password, validatePassword)
watch(
() => userStore.errorMessage,
......@@ -180,11 +179,11 @@ watch(
placeholder="Bekreft passord"
type="password"
/>
<div class="ml-4">
<p class="text-sm">
<span v-for="message in passwordValidations" :key="message">{{ message }}</span>
</p>
</div>
<div class="ml-4">
<p class="text-sm">
<span v-for="message in passwordValidations" :key="message">{{ message }}</span>
</p>
</div>
</div>
<div class="flex flex-row gap-5">
<button
......
import { describe, expect, it, beforeEach } from 'vitest';
import { mount } from '@vue/test-utils';
import { createPinia, setActivePinia } from 'pinia';
import ButtonComponent from '@/components/ButtonDisplayStreak.vue';
import { describe, expect, it, beforeEach } from 'vitest'
import { mount } from '@vue/test-utils'
import { createPinia, setActivePinia } from 'pinia'
import ButtonComponent from '@/components/ButtonDisplayStreak.vue'
describe('ButtonComponent', () => {
beforeEach(() => {
setActivePinia(createPinia());
});
setActivePinia(createPinia())
})
it('renders correctly', () => {
const wrapper = mount(ButtonComponent, {
props: {
buttonText: 'Click me',
type: 'goal',
},
});
expect(wrapper.exists()).toBe(true);
});
});
type: 'goal'
}
})
expect(wrapper.exists()).toBe(true)
})
})
......@@ -6,8 +6,8 @@
Legg til kontonummer for sparekonto og brukskonto
</h1>
<div class="absolute bottom-0 md:bottom-40 left-0 w-40 h-40 md:w-52 md:h-52 ml-4">
<p class="text-sm font-bold mb-3 animate-bounce">Trykk på meg for hjelp ❗️</p>
<SpareComponent
<p class="text-sm font-bold mb-3 animate-bounce">Trykk på meg for hjelp ❗️</p>
<SpareComponent
:speech="[
'Her skriver du inn kontonummer for sparekonto og brukskonto. 🪩',
'Sparekonto er kontoen du vil legge alle dine oppsparte penger på!',
......@@ -49,8 +49,8 @@
/>
</div>
</div>
<p class="mt-10">Husk at du kan endre dette senere!</p>
<div class="absolute bottom-36 right-2">
<p class="mt-10">Husk at du kan endre dette senere!</p>
<div class="absolute bottom-36 right-2">
<ContinueButtonComponent
@click="onButtonClick"
:disabled="!isFormValid"
......
<template>
<div class="flex flex-col items-center justify-center min-h-screen px-4 text-center">
<h1 class="mb-8 md:mb-16 mt-2 text-2xl font-bold sm:text-4xl">
<h1 class="mb-8 md:mb-16 mt-2 text-2xl font-bold sm:text-4xl">
Hvor kjent er du med sparing fra før?
</h1>
<div class="absolute bottom-4 md:bottom-40 left-2 w-28 h-28 md:w-40 md:h-40 lg:w-52 lg:h-52 ml-4">
<p class="md:text-sm text-xs font-bold mb-3 animate-bounce invisible sm:visible">Trykk på meg for hjelp ❗️</p>
<div
class="absolute bottom-4 md:bottom-40 left-2 w-28 h-28 md:w-40 md:h-40 lg:w-52 lg:h-52 ml-4"
>
<p class="md:text-sm text-xs font-bold mb-3 animate-bounce invisible sm:visible">
Trykk på meg for hjelp ❗️
</p>
<SpareComponent
:speech="[
'Her kan du fylle inn hvor kjent du er med sparing fra før, slik at vi kan hjelpe deg på best mulig måte! 💡',
......@@ -15,7 +19,7 @@
:imageDirection="'right'"
></SpareComponent>
</div>
<div class="grid grid-cols-1 gap-8 mb-2 sm:gap-10 sm:mb-12 md:grid-cols-3">
<div class="grid grid-cols-1 gap-8 mb-2 sm:gap-10 sm:mb-12 md:grid-cols-3">
<div
:class="{
'border-[var(--green)] border-4': selectedOption === 'litt',
......@@ -50,7 +54,7 @@
<p class="mt-2 text-lg font-bold">Godt kjent</p>
</div>
</div>
<p class="mb-4 md:mb-10">Husk at du kan endre dette senere!</p>
<p class="mb-4 md:mb-10">Husk at du kan endre dette senere!</p>
<ContinueButtonComponent
:disabled="selectedOption === null"
@click="onButtonClick"
......
<template>
<div class="flex flex-col items-center justify-center min-h-screen px-4 text-center">
<h1 class="mb-8 md:mb-16 mt-2 text-2xl font-bold sm:text-4xl">
<h1 class="mb-8 md:mb-16 mt-2 text-2xl font-bold sm:text-4xl">
Hvor store vaneedringer er du villig til å gjøre?
</h1>
<div class="absolute bottom-4 md:bottom-40 left-2 w-28 h-28 md:w-40 md:h-40 lg:w-52 lg:h-52 ml-4">
<p class="md:text-sm text-xs font-bold mb-3 animate-bounce invisible sm:visible">Trykk på meg for hjelp ❗️</p>
<div
class="absolute bottom-4 md:bottom-40 left-2 w-28 h-28 md:w-40 md:h-40 lg:w-52 lg:h-52 ml-4"
>
<p class="md:text-sm text-xs font-bold mb-3 animate-bounce invisible sm:visible">
Trykk på meg for hjelp ❗️
</p>
<SpareComponent
:speech="[
'Her kan du velge hvor mye innsats du er villig til å legge inn for å endre vanene dine! 📚',
......@@ -50,7 +54,7 @@
<p class="mt-2 text-md sm:text-lg font-bold">Store</p>
</div>
</div>
<p class="mb-4 md:mb-10">Husk at du kan endre dette senere!</p>
<p class="mb-4 md:mb-10">Husk at du kan endre dette senere!</p>
<ContinueButtonComponent
:disabled="selectedOption === null"
@click="onButtonClick"
......
<template>
<div class="flex flex-col items-center justify-center min-h-screen px-4 text-center relative">
<h1 class="mb-2 text-2xl font-bold sm:text-4xl">
Hvor mye bruker du per kjøp på ...
</h1>
<p class="text-sm mb-8 md:mb-10">Her kan du skrive inn hvor mye du bruker per kjøp på ulike kategorier</p>
<div class="md:absolute fixed bottom-3 md:bottom-40 left-2 w-28 h-28 md:w-40 md:h-40 lg:w-52 lg:h-52 ml-4">
<p class="md:text-sm text-xs font-bold mb-3 animate-bounce invisible sm:visible">Trykk på meg for hjelp ❗️</p>
<h1 class="mb-2 text-2xl font-bold sm:text-4xl">Hvor mye bruker du per kjøp på ...</h1>
<p class="text-sm mb-8 md:mb-10">
Her kan du skrive inn hvor mye du bruker per kjøp på ulike kategorier
</p>
<div
class="md:absolute fixed bottom-3 md:bottom-40 left-2 w-28 h-28 md:w-40 md:h-40 lg:w-52 lg:h-52 ml-4"
>
<p class="md:text-sm text-xs font-bold mb-3 animate-bounce invisible sm:visible">
Trykk på meg for hjelp ❗️
</p>
<SpareComponent
:speech="[
'Her kan du skrive inn hvor mye penger du bruker per kjøp på ulike ting. 🍔',
......@@ -78,7 +82,7 @@
</div>
</div>
</div>
<p class="mt-10">Husk at du kan endre dette senere!</p>
<p class="mt-10">Husk at du kan endre dette senere!</p>
<div class="w-full text-right">
<ContinueButtonComponent
@click="onButtonClick"
......
<template>
<div class="flex flex-col items-center justify-center min-h-screen px-4 text-center relative">
<h1 class="mb-2 text-2xl font-bold sm:text-4xl">
Hvor mye bruker du per uke på ...
</h1>
<p class="text-sm mb-8 md:mb-10">Her kan du skrive inn hvor mye du bruker per uke på ulike kategorier</p>
<h1 class="mb-2 text-2xl font-bold sm:text-4xl">Hvor mye bruker du per uke på ...</h1>
<p class="text-sm mb-8 md:mb-10">
Her kan du skrive inn hvor mye du bruker per uke på ulike kategorier
</p>
<div class="absolute bottom-0 md:bottom-40 left-0 w-40 h-40 md:w-52 md:h-52 ml-4">
<p class="text-sm font-bold mb-3 animate-bounce">Trykk på meg for hjelp ❗️</p>
<p class="text-sm font-bold mb-3 animate-bounce">Trykk på meg for hjelp ❗️</p>
<SpareComponent
:speech="[
'Her skal du skrive inn hvor mye du bruker per uke på ulike kategorier. 🗓️',
......@@ -78,7 +78,7 @@
</div>
</div>
</div>
<p class="mt-10">Husk at du kan endre dette senere!</p>
<p class="mt-10">Husk at du kan endre dette senere!</p>
<div class="w-full text-right">
<ContinueButtonComponent
@click="onButtonClick"
......
<template>
<div class="flex flex-col items-center justify-center min-h-screen text-center">
<h1 class="mb-3 text-2xl font-bold sm:text-4xl mt-0 md:mt-7">Hva bruker du mye penger på?</h1>
<p class="text-sm mb-8 md:mb-10">Hvis du ikke finner noe som passer, kan du skrive inn egne kategorier i "Annet ..." feltet</p>
<div class="md:absolute fixed bottom-3 md:bottom-40 left-2 w-28 h-28 md:w-40 md:h-40 lg:w-52 lg:h-52 ml-4">
<p class="md:text-sm text-xs font-bold mb-3 animate-bounce invisible sm:visible">Trykk på meg for hjelp ❗️</p>
<h1 class="mb-3 text-2xl font-bold sm:text-4xl mt-0 md:mt-7">
Hva bruker du mye penger på?
</h1>
<p class="text-sm mb-8 md:mb-10">
Hvis du ikke finner noe som passer, kan du skrive inn egne kategorier i "Annet ..."
feltet
</p>
<div
class="md:absolute fixed bottom-3 md:bottom-40 left-2 w-28 h-28 md:w-40 md:h-40 lg:w-52 lg:h-52 ml-4"
>
<p class="md:text-sm text-xs font-bold mb-3 animate-bounce invisible sm:visible">
Trykk på meg for hjelp ❗️
</p>
<SpareComponent
:speech="[
'Her kan du velge hva du bruker mye penger på, slik at vi kan hjelpe deg med å spare penger! 💸',
......@@ -68,7 +77,7 @@
</div>
</div>
</div>
<p class="mb-1">Husk at du kan endre dette senere!</p>
<p class="mb-1">Husk at du kan endre dette senere!</p>
<div class="w-full text-right">
<ContinueButtonComponent
@click="onButtonClick"
......
......@@ -9,7 +9,9 @@
:imageDirection="'right'"
class="my-10 md:ml-5"
></SpareComponent>
<div class="flex flex-col gap-2 items-center mx-auto mt-4 mb-20 md:gap-4 md:m-0 md:ml-4 w-full">
<div
class="flex flex-col gap-2 items-center mx-auto mt-4 mb-20 md:gap-4 md:m-0 md:ml-4 w-full"
>
<ButtonAddGoalOrChallenge :buttonText="'Legg til sparemål'" :type="'goal'" />
<ButtonAddGoalOrChallenge
:buttonText="'Legg til spareutfordring'"
......
......@@ -315,9 +315,7 @@ const removeUploadedFile = () => {
>
<InteractiveSpare
:png-size="10"
:speech="[
`Trenger du hjelp? Trykk på ❓ nede i høyre hjørne!`
]"
:speech="[`Trenger du hjelp? Trykk på ❓ nede i høyre hjørne!`]"
direction="left"
/>
</div>
......
......@@ -337,9 +337,7 @@ onMounted(async () => {
>
<InteractiveSpare
:png-size="10"
:speech="[
`Trenger du hjelp? Trykk på ❓ nede i høyre hjørne!`
]"
:speech="[`Trenger du hjelp? Trykk på ❓ nede i høyre hjørne!`]"
direction="left"
/>
</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