From 3cdb524b77f40c90491e8182f3d363852ffad468 Mon Sep 17 00:00:00 2001 From: Kamil Mielnik Date: Sun, 27 Oct 2024 15:24:57 +0700 Subject: [PATCH] Fix .gitignore and bring back missing test --- .gitignore | 3 +- .../bugs/363-dictionary-input-unique-words.ts | 41 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/bugs/363-dictionary-input-unique-words.ts diff --git a/.gitignore b/.gitignore index 2ade0079..0f1c8680 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,8 @@ .nx/ build/ coverage/ -cypress/ +cypress/downloads +cypress/screenshots node_modules/ *.eslintcache *.db diff --git a/cypress/e2e/bugs/363-dictionary-input-unique-words.ts b/cypress/e2e/bugs/363-dictionary-input-unique-words.ts new file mode 100644 index 00000000..aca61cd8 --- /dev/null +++ b/cypress/e2e/bugs/363-dictionary-input-unique-words.ts @@ -0,0 +1,41 @@ +import { + closeModal, + getDictionaryInput, + getResult, + getSettingOption, + getSettingsButton, + solve, + typeBoard, + typeRack, + unregisterServiceWorkers, + visitIndex, +} from '../../support'; + +/* + * @see https://github.com/kamilmielnik/scrabble-solver/issues/363 + */ +describe('#363 - Dictionary input should display unique words', () => { + beforeEach(async () => { + await unregisterServiceWorkers(); + }); + + afterEach(() => { + cy.clearLocalStorage(); + }); + + it('highlighting a word should cause only unique new words to be looked up in the dictionary', () => { + cy.intercept('GET', '/api/dictionary/tr-TR/*', { delay: 100 }).as('dictionary'); + + visitIndex(); + getSettingsButton().realClick(); + getSettingOption('Language', 'Türkçe').check(); + closeModal(); + typeBoard('ponje', 'horizontal', 3, 7); + typeRack('er'); + solve(); + + getResult(0).realHover(); + + getDictionaryInput().should('have.value', 'er, je'); + }); +});