From 31c965611c9e637a80415f653ff706cfdf47ac6b Mon Sep 17 00:00:00 2001 From: Mirko Lorusso Date: Sun, 23 Apr 2023 01:13:35 +0200 Subject: [PATCH 01/24] Test that characters are highlighted when clicked --- cypress/e2e/guesses.cy.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 cypress/e2e/guesses.cy.js diff --git a/cypress/e2e/guesses.cy.js b/cypress/e2e/guesses.cy.js new file mode 100644 index 0000000..b4b4bd9 --- /dev/null +++ b/cypress/e2e/guesses.cy.js @@ -0,0 +1,11 @@ +describe('a character is highlighted when clicked', () => { + it('should highlight a character with a red border when the user clicks on it', () => { + cy.visit('/') + .get('div.centered') + .contains('_') + .should('be.visible') + .click() + .should('have.css', 'border', '2px solid red') + .should('have.css', 'border-radius', '5px') + }) +}) From 5314bf3c5b788fbeed35f596d1b2d6ca4ca97c0f Mon Sep 17 00:00:00 2001 From: Mirko Lorusso Date: Sun, 23 Apr 2023 18:20:26 +0200 Subject: [PATCH 02/24] Revert "Test that characters are highlighted when clicked" This reverts commit 31c965611c9e637a80415f653ff706cfdf47ac6b. --- cypress/e2e/guesses.cy.js | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 cypress/e2e/guesses.cy.js diff --git a/cypress/e2e/guesses.cy.js b/cypress/e2e/guesses.cy.js deleted file mode 100644 index b4b4bd9..0000000 --- a/cypress/e2e/guesses.cy.js +++ /dev/null @@ -1,11 +0,0 @@ -describe('a character is highlighted when clicked', () => { - it('should highlight a character with a red border when the user clicks on it', () => { - cy.visit('/') - .get('div.centered') - .contains('_') - .should('be.visible') - .click() - .should('have.css', 'border', '2px solid red') - .should('have.css', 'border-radius', '5px') - }) -}) From e6a1fbf9412b6f274e1ede379e67547c2335a860 Mon Sep 17 00:00:00 2001 From: Mirko Lorusso Date: Sun, 23 Apr 2023 18:35:58 +0200 Subject: [PATCH 03/24] Fix page layout --- cypress/e2e/game-loading.cy.js | 2 ++ index.html | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/cypress/e2e/game-loading.cy.js b/cypress/e2e/game-loading.cy.js index 27e7fc0..cd941ea 100644 --- a/cypress/e2e/game-loading.cy.js +++ b/cypress/e2e/game-loading.cy.js @@ -8,11 +8,13 @@ describe('the word is hidden when the game starts', () => { it('should display the word hidden with underscores', () => { cy.visit('/') .get('div.centered') + .get('div#word') .contains('_') .should('be.visible') cy.visit('/') .get('div.centered') + .get('div#word') .invoke('text') .should('match', /(_)+/) }) diff --git a/index.html b/index.html index cf5d4bb..4fe6af3 100644 --- a/index.html +++ b/index.html @@ -24,16 +24,20 @@
- +
+ +
From 3cc429f0ff38e836946e0171659ddb5c2036c11f Mon Sep 17 00:00:00 2001 From: Mirko Lorusso Date: Mon, 24 Apr 2023 00:56:42 +0200 Subject: [PATCH 12/24] Show guessed chars (wip) --- index.html | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index f8846bd..7a1396a 100644 --- a/index.html +++ b/index.html @@ -52,15 +52,26 @@ From 53ab9fb90a7796b16d15799365552115ec530f5b Mon Sep 17 00:00:00 2001 From: Mirko Lorusso Date: Mon, 24 Apr 2023 17:21:40 +0200 Subject: [PATCH 15/24] Try to centralize variables in store (wip) --- index.html | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index b289682..dcf8d14 100644 --- a/index.html +++ b/index.html @@ -27,9 +27,9 @@
+ x-data="{ word: $store.store.word }">
-