From c366ed9f81150f65943ad34567f8dbb498eb371c Mon Sep 17 00:00:00 2001
From: heikkkk <henrik.teksle.sandok@hotmail.no>
Date: Wed, 1 May 2024 11:50:38 +0200
Subject: [PATCH] test: begin e2e on settings profile

---
 cypress/e2e/Settings/SettingsProfileView.cy.ts | 14 ++++++++++++++
 src/views/Settings/SettingsProfileView.vue     | 16 ++++++++++------
 2 files changed, 24 insertions(+), 6 deletions(-)
 create mode 100644 cypress/e2e/Settings/SettingsProfileView.cy.ts

diff --git a/cypress/e2e/Settings/SettingsProfileView.cy.ts b/cypress/e2e/Settings/SettingsProfileView.cy.ts
new file mode 100644
index 0000000..bfdcfb7
--- /dev/null
+++ b/cypress/e2e/Settings/SettingsProfileView.cy.ts
@@ -0,0 +1,14 @@
+describe('SettingsProfile Test', () => {
+  beforeEach(() => {
+    cy.visit('/login');
+    cy.get('#emailInput input').type('user@example.com');
+    cy.get('#passwordInput input').type('John1');
+    cy.get('form').submit();
+    cy.wait(1000);
+    cy.visit('/settings/profile')
+  });
+
+  it('Does the before', () => {
+
+  })
+})
\ No newline at end of file
diff --git a/src/views/Settings/SettingsProfileView.vue b/src/views/Settings/SettingsProfileView.vue
index 4b5fb7e..56188cc 100644
--- a/src/views/Settings/SettingsProfileView.vue
+++ b/src/views/Settings/SettingsProfileView.vue
@@ -114,15 +114,19 @@ onMounted(() => {
         </div>
       </div>
       <div class="form-group">
-        <BaseInput :model-value="firstNameRef" @input-change-event="handleFirstNameInputEvent" id="firstNameInputChange"
-          input-id="first-name-new" type="text" label="Fornavn" placeholder="Skriv inn ditt fornavn"
-          invalid-message="Vennligst skriv inn ditt fornavn" />
+        <BaseInput data-cy="first-name" :model-value="firstNameRef"
+                   @input-change-event="handleFirstNameInputEvent" id="firstNameInputChange"
+                   input-id="first-name-new" type="text" label="Fornavn" placeholder="Skriv inn ditt fornavn"
+                   invalid-message="Vennligst skriv inn ditt fornavn" />
       </div>
       <br>
       <div class="form-group">
-        <BaseInput :model-value="surnameRef" @input-change-event="handleSurnameInputEvent" id="surnameInput-change"
-          input-id="surname-new" type="text" label="Etternavn" placeholder="Skriv inn ditt etternavn"
-          invalid-message="Vennligst skriv inn ditt etternavn" />
+        <BaseInput data-cy="last-name" :model-value="surnameRef"
+                   @input-change-event="handleSurnameInputEvent"
+                    id="surnameInput-change"
+                   input-id="surname-new" type="text" label="Etternavn"
+                   placeholder="Skriv inn ditt etternavn"
+                   invalid-message="Vennligst skriv inn ditt etternavn" />
       </div>
       <br>
       <button type="submit" class="btn btn-primary">Oppdater profil</button>
-- 
GitLab