scrabble-solver 2.13.13 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build.yml +6 -14
- package/.github/workflows/cypress.yml +12 -8
- package/.github/workflows/eslint.yml +4 -10
- package/.github/workflows/jest.yml +4 -10
- package/.nx/cache/nx_files.nxt +0 -0
- package/.nx/workspace-data/file-map.json +319 -275
- package/.nx/workspace-data/lockfile.hash +1 -1
- package/.nx/workspace-data/parsed-lock-file.json +352 -277
- package/.nx/workspace-data/project-graph.json +583 -463
- package/README.md +12 -10
- package/bin/scrabble-solver.js +0 -0
- package/cypress/e2e/app.spec.cy.ts +87 -76
- package/cypress/e2e/bugs/112-character-bonus.ts +40 -0
- package/cypress/e2e/bugs/129-esc-sidebar.ts +23 -0
- package/cypress/e2e/bugs/2-q-tile-in-english.ts +33 -0
- package/cypress/e2e/bugs/3-x-tile-in-polish.ts +33 -0
- package/cypress/e2e/bugs/30-click-inside-radio-icon.ts +26 -0
- package/cypress/e2e/bugs/333-disabled-radio-cursor.ts +24 -0
- package/cypress/e2e/bugs/342-results-sorting.ts +48 -0
- package/cypress/e2e/bugs/348-results-word-padding.ts +74 -0
- package/cypress/e2e/bugs.spec.cy.ts +8 -0
- package/lerna.json +1 -1
- package/package.json +24 -15
- package/packages/configs/build/games/index.d.ts +4 -3
- package/packages/configs/build/games/index.js +17 -9
- package/packages/configs/build/games/kelimelik.d.ts +16 -0
- package/packages/configs/build/games/kelimelik.js +64 -0
- package/packages/configs/build/games/literaki.d.ts +1 -2
- package/packages/configs/build/games/literaki.js +2 -2
- package/packages/configs/build/games/scrabble.d.ts +1 -2
- package/packages/configs/build/games/scrabble.js +2 -2
- package/packages/configs/build/games/superScrabble.d.ts +1 -2
- package/packages/configs/build/games/superScrabble.js +2 -2
- package/packages/configs/build/languages/index.d.ts +1 -0
- package/packages/configs/build/languages/index.js +1 -0
- package/packages/configs/build/languages/turkish.d.ts +3 -0
- package/packages/configs/build/languages/turkish.js +75 -0
- package/packages/configs/package.json +3 -3
- package/packages/configs/src/games/index.ts +4 -3
- package/packages/configs/src/games/kelimelik.ts +62 -0
- package/packages/configs/src/games/literaki.ts +1 -3
- package/packages/configs/src/games/scrabble.ts +1 -3
- package/packages/configs/src/games/superScrabble.ts +1 -3
- package/packages/configs/src/languages/index.ts +1 -0
- package/packages/configs/src/languages/turkish.ts +75 -0
- package/packages/constants/build/index.js +2 -2
- package/packages/constants/package.json +1 -1
- package/packages/constants/src/index.ts +2 -2
- package/packages/dictionaries/package-lock.json +2 -2
- package/packages/dictionaries/package.json +4 -4
- package/packages/logger/package-lock.json +2 -2
- package/packages/logger/package.json +1 -1
- package/packages/scrabble-solver/.next/BUILD_ID +1 -1
- package/packages/scrabble-solver/.next/build-manifest.json +5 -5
- package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
- package/packages/scrabble-solver/.next/cache/eslint/.cache_8dgz12 +1 -1
- package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/prerender-manifest.js +1 -1
- package/packages/scrabble-solver/.next/prerender-manifest.json +1 -1
- package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
- package/packages/scrabble-solver/.next/server/chunks/807.js +1 -1
- package/packages/scrabble-solver/.next/server/chunks/911.js +1 -1
- package/packages/scrabble-solver/.next/server/chunks/977.js +1 -1
- package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/404.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/404.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/500.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +2 -2
- package/packages/scrabble-solver/.next/server/pages/index.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
- package/packages/scrabble-solver/.next/server/pages-manifest.json +1 -1
- package/packages/scrabble-solver/.next/static/{qwJjm2FeDHHGY92CY5oQQ → C0yfLTukP3L3iDqdXbbBv}/_buildManifest.js +1 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/_app-e73bbdbc75537614.js +17 -0
- package/packages/scrabble-solver/.next/static/chunks/pages/index-4143525ec0fa83bb.js +1 -0
- package/packages/scrabble-solver/.next/static/css/{2adc9736d823979b.css → ac3349339fcf58f2.css} +1 -1
- package/packages/scrabble-solver/.next/trace +45 -45
- package/packages/scrabble-solver/package-lock.json +4 -4
- package/packages/scrabble-solver/package.json +11 -11
- package/packages/scrabble-solver/public/service-worker.js +2 -2
- package/packages/scrabble-solver/public/service-worker.js.map +1 -1
- package/packages/scrabble-solver/src/components/Alert/Alert.tsx +1 -1
- package/packages/scrabble-solver/src/components/Board/Board.tsx +3 -3
- package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +1 -1
- package/packages/scrabble-solver/src/components/Button/Button.tsx +1 -1
- package/packages/scrabble-solver/src/components/IconButton/IconButton.tsx +1 -1
- package/packages/scrabble-solver/src/components/IconButton/Link.tsx +1 -1
- package/packages/scrabble-solver/src/components/Keys/Arrows/Arrows.tsx +4 -4
- package/packages/scrabble-solver/src/components/NotFound/NotFound.tsx +1 -1
- package/packages/scrabble-solver/src/components/Radio/Radio.module.scss +3 -2
- package/packages/scrabble-solver/src/components/Radio/Radio.tsx +1 -1
- package/packages/scrabble-solver/src/components/Results/HeaderButton.tsx +1 -1
- package/packages/scrabble-solver/src/components/Results/Results.module.scss +5 -8
- package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +1 -1
- package/packages/scrabble-solver/src/components/Tile/TilePure.tsx +1 -1
- package/packages/scrabble-solver/src/i18n/constants.ts +12 -1
- package/packages/scrabble-solver/src/i18n/i18n.ts +2 -0
- package/packages/scrabble-solver/src/i18n/languages/turkish.json +78 -0
- package/packages/scrabble-solver/src/icons/FlagTr.svg +4 -0
- package/packages/scrabble-solver/src/icons/index.ts +1 -0
- package/packages/scrabble-solver/src/modals/MenuModal/MenuModal.tsx +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +1 -1
- package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.tsx +2 -2
- package/packages/scrabble-solver/src/pages/_app.tsx +11 -2
- package/packages/solver/package-lock.json +2 -2
- package/packages/solver/package.json +5 -5
- package/packages/types/build/Game.d.ts +1 -0
- package/packages/types/build/Game.js +1 -0
- package/packages/types/build/Locale.d.ts +2 -1
- package/packages/types/build/Locale.js +1 -0
- package/packages/types/package.json +2 -2
- package/packages/types/src/Game.ts +1 -0
- package/packages/types/src/Locale.ts +1 -0
- package/packages/word-definitions/build/crawl.js +1 -0
- package/packages/word-definitions/build/index.d.ts +1 -1
- package/packages/word-definitions/build/index.js +1 -3
- package/packages/word-definitions/build/languages/index.d.ts +1 -0
- package/packages/word-definitions/build/languages/index.js +2 -1
- package/packages/word-definitions/build/languages/turkish.d.ts +3 -0
- package/packages/word-definitions/build/languages/turkish.js +31 -0
- package/packages/word-definitions/build/lib/index.d.ts +3 -3
- package/packages/word-definitions/build/lib/index.js +17 -7
- package/packages/word-definitions/build/parse.js +1 -0
- package/packages/word-definitions/package-lock.json +2 -2
- package/packages/word-definitions/package.json +2 -2
- package/packages/word-definitions/src/__tests__/expected/tr-TR.lojik.json +4 -0
- package/packages/word-definitions/src/__tests__/input/tr-TR.lojik.html +1 -0
- package/packages/word-definitions/src/crawl.ts +2 -1
- package/packages/word-definitions/src/index.ts +1 -2
- package/packages/word-definitions/src/languages/index.ts +1 -0
- package/packages/word-definitions/src/languages/turkish.ts +32 -0
- package/packages/word-definitions/src/lib/index.ts +3 -3
- package/packages/word-definitions/src/parse.test.ts +1 -0
- package/packages/word-definitions/src/parse.ts +2 -1
- package/packages/word-lists/build/getWordList.js +1 -0
- package/packages/word-lists/build/languages/index.d.ts +1 -0
- package/packages/word-lists/build/languages/index.js +2 -1
- package/packages/word-lists/build/languages/turkish.d.ts +1 -0
- package/packages/word-lists/build/languages/turkish.js +10 -0
- package/packages/word-lists/package-lock.json +3 -3
- package/packages/word-lists/package.json +3 -3
- package/packages/word-lists/src/getWordList.ts +2 -1
- package/packages/word-lists/src/languages/index.ts +1 -0
- package/packages/word-lists/src/languages/turkish.ts +9 -0
- package/cypress/e2e/bugs/112.spec.cy.ts +0 -29
- package/cypress/e2e/bugs/129.spec.cy.ts +0 -13
- package/cypress/e2e/bugs/2.spec.cy.ts +0 -15
- package/cypress/e2e/bugs/3.spec.cy.ts +0 -15
- package/cypress/e2e/bugs/342.spec.cy.ts +0 -37
- package/cypress/e2e/bugs/348.spec.cy.ts +0 -73
- package/packages/scrabble-solver/.next/static/chunks/pages/_app-42ce6b4032e931ff.js +0 -17
- package/packages/scrabble-solver/.next/static/chunks/pages/index-3718075f2ba2220c.js +0 -1
- /package/packages/scrabble-solver/.next/static/{qwJjm2FeDHHGY92CY5oQQ → C0yfLTukP3L3iDqdXbbBv}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
<img height="32" src="https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f1f5-1f1f1.svg" alt="Flag of Poland" title="Polish" />
|
|
31
31
|
<img height="32" src="https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f1f7-1f1f4.svg" alt="Flag of Romania" title="Romanian" />
|
|
32
32
|
<img height="32" src="https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f1ea-1f1f8.svg" alt="Flag of Spain" title="Spanish" />
|
|
33
|
+
<img height="32" src="https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f1f9-1f1f7.svg" alt="Flag of Turkey" title="Turkish" />
|
|
33
34
|
</p>
|
|
34
35
|
|
|
35
36
|
<p>
|
|
@@ -67,16 +68,17 @@
|
|
|
67
68
|
|
|
68
69
|
## Dictionaries
|
|
69
70
|
|
|
70
|
-
| Language | Word list | Word definitions
|
|
71
|
-
|
|
72
|
-
| 🇬🇧 English | [💾](https://www.wordgamedictionary.com/sowpods/download/sowpods.txt) [SOWPODS](https://en.wikipedia.org/wiki/Collins_Scrabble_Words) | [Merriam-Webster](https://www.merriam-webster.com/)
|
|
73
|
-
| 🇺🇸 English | [💾](https://www.wordgamedictionary.com/twl06/download/twl06.txt) [TWL06](https://en.wikipedia.org/wiki/NASPA_Word_List) | [Merriam-Webster](https://www.merriam-webster.com/)
|
|
74
|
-
| 🇫🇷 French | [💾](https://raw.githubusercontent.com/Thecoolsim/French-Scrabble-ODS8/main/French%20ODS%20dictionary.txt) [ODS8](https://github.com/Thecoolsim/French-Scrabble-ODS8) | [CNRTL](https://www.cnrtl.fr/)
|
|
75
|
-
| 🇩🇪 German | [💾](https://raw.githubusercontent.com/hippler/german-wordlist/master/words.txt) [hippler/german-wordlist](https://github.com/hippler/german-wordlist) | [DWDS](https://www.dwds.de)
|
|
76
|
-
| 🇮🇷 Persian | [💾](https://raw.githubusercontent.com/MansourM/persian-to-persian-dictionary/main/moein/words.txt) [MansourM/persian-to-persian-dictionary](https://github.com/MansourM/persian-to-persian-dictionary) | [واژه یاب](https://vajehyab.com)
|
|
77
|
-
| 🇵🇱 Polish | [💾](https://sjp.pl/slownik/growy/) [SJP.PL](https://sjp.pl/slownik/dp.phtml) | [SJP.PL](https://sjp.pl)
|
|
78
|
-
| 🇷🇴 Romanian | [💾](https://dexonline.ro/static/download/scrabble/loc-flexiuni-5.0.zip) [LOC 5](https://dexonline.ro/scrabble) | [dexonline](https://dexonline.ro/)
|
|
79
|
-
| 🇪🇸 Spanish | [💾](https://github.com/kamilmielnik/scrabble-dictionaries/blob/master/spanish/file-2017.txt) [FILE 2017](https://www.facebook.com/Escrablistica) | [Diccionarios.com](https://www.diccionarios.com/)
|
|
71
|
+
| Language | Word list | Word definitions | [Highest-scoring word](https://codesandbox.io/s/highest-scoring-words-in-scrabble-vbj1ns?file=/src/index.js) |
|
|
72
|
+
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|
|
|
73
|
+
| 🇬🇧 English | [💾](https://www.wordgamedictionary.com/sowpods/download/sowpods.txt) [SOWPODS](https://en.wikipedia.org/wiki/Collins_Scrabble_Words) | [Merriam-Webster](https://www.merriam-webster.com/) | oxyphenbutazone (1458) |
|
|
74
|
+
| 🇺🇸 English | [💾](https://www.wordgamedictionary.com/twl06/download/twl06.txt) [TWL06](https://en.wikipedia.org/wiki/NASPA_Word_List) | [Merriam-Webster](https://www.merriam-webster.com/) | oxyphenbutazone (1458) |
|
|
75
|
+
| 🇫🇷 French | [💾](https://raw.githubusercontent.com/Thecoolsim/French-Scrabble-ODS8/main/French%20ODS%20dictionary.txt) [ODS8](https://github.com/Thecoolsim/French-Scrabble-ODS8) | [CNRTL](https://www.cnrtl.fr/) | schizothymiques (1566) |
|
|
76
|
+
| 🇩🇪 German | [💾](https://raw.githubusercontent.com/hippler/german-wordlist/master/words.txt) [hippler/german-wordlist](https://github.com/hippler/german-wordlist) | [DWDS](https://www.dwds.de) | polytoxikomanem (1512) |
|
|
77
|
+
| 🇮🇷 Persian | [💾](https://raw.githubusercontent.com/MansourM/persian-to-persian-dictionary/main/moein/words.txt) [MansourM/persian-to-persian-dictionary](https://github.com/MansourM/persian-to-persian-dictionary) | [واژه یاب](https://vajehyab.com) | (756) اگزیستانسیالیست |
|
|
78
|
+
| 🇵🇱 Polish | [💾](https://sjp.pl/slownik/growy/) [SJP.PL](https://sjp.pl/slownik/dp.phtml) | [SJP.PL](https://sjp.pl) | współposiądźmyż (1512) |
|
|
79
|
+
| 🇷🇴 Romanian | [💾](https://dexonline.ro/static/download/scrabble/loc-flexiuni-5.0.zip) [LOC 5](https://dexonline.ro/scrabble) | [dexonline](https://dexonline.ro/) | luxemburghezele (1944) |
|
|
80
|
+
| 🇪🇸 Spanish | [💾](https://github.com/kamilmielnik/scrabble-dictionaries/blob/master/spanish/file-2017.txt) [FILE 2017](https://www.facebook.com/Escrablistica) | [Diccionarios.com](https://www.diccionarios.com/) | flexibilizabais (1323) |
|
|
81
|
+
| 🇹🇷 Turkish | [💾](https://github.com/kamilmielnik/scrabble-dictionaries/blob/master/turkish/turkish.txt) Turkish | [Türk Dil Kurumu Sözlükleri](https://sozluk.gov.tr/) | |
|
|
80
82
|
|
|
81
83
|
## Run
|
|
82
84
|
|
package/bin/scrabble-solver.js
CHANGED
|
File without changes
|
|
@@ -13,95 +13,106 @@ import {
|
|
|
13
13
|
getTooltip,
|
|
14
14
|
solve,
|
|
15
15
|
typeRack,
|
|
16
|
+
unregisterServiceWorkers,
|
|
16
17
|
visitIndex,
|
|
17
18
|
} from '../support';
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
20
|
+
describe('app', () => {
|
|
21
|
+
beforeEach(async () => {
|
|
22
|
+
await unregisterServiceWorkers();
|
|
23
|
+
});
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
afterEach(() => {
|
|
26
|
+
cy.clearLocalStorage();
|
|
27
|
+
});
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
getSettingOption('Coordinates', 'Hidden').should('be.checked');
|
|
32
|
-
getSettingOption('Input mode', 'Keyboard').should('be.checked');
|
|
33
|
-
getSettingOption('Group remaining tiles', 'Do not group').should('be.checked');
|
|
34
|
-
});
|
|
29
|
+
it('has title', () => {
|
|
30
|
+
visitIndex();
|
|
35
31
|
|
|
36
|
-
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
cy.intercept('/api/solve').as('solve');
|
|
39
|
-
cy.intercept('/api/dictionary/**/*').as('dictionary');
|
|
32
|
+
cy.title().should('equal', 'Scrabble Solver 2 by Kamil Mielnik');
|
|
40
33
|
});
|
|
41
34
|
|
|
42
|
-
it('
|
|
35
|
+
it('has default setting values', () => {
|
|
43
36
|
visitIndex();
|
|
44
37
|
getSettingsButton().realClick();
|
|
45
|
-
getSettingOption('Language', 'Polski').check();
|
|
46
|
-
getSettingOption('Współrzędne', 'Oryginalne').check();
|
|
47
|
-
closeModal();
|
|
48
|
-
typeRack('abł');
|
|
49
|
-
solve();
|
|
50
38
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
39
|
+
getSettingOption('Game', 'Scrabble').should('be.checked');
|
|
40
|
+
getSettingOption('Language', 'English (US)').should('be.checked');
|
|
41
|
+
getSettingOption('Coordinates', 'Hidden').should('be.checked');
|
|
42
|
+
getSettingOption('Input mode', 'Keyboard').should('be.checked');
|
|
43
|
+
getSettingOption('Group remaining tiles', 'Do not group').should('be.checked');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe('full app test', () => {
|
|
47
|
+
beforeEach(() => {
|
|
48
|
+
cy.intercept('/api/solve').as('solve');
|
|
49
|
+
cy.intercept('/api/dictionary/**/*').as('dictionary');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('Scrabble - Polish', () => {
|
|
53
|
+
visitIndex();
|
|
54
|
+
getSettingsButton().realClick();
|
|
55
|
+
getSettingOption('Language', 'Polski').check();
|
|
56
|
+
getSettingOption('Współrzędne', 'Oryginalne').check();
|
|
57
|
+
closeModal();
|
|
58
|
+
typeRack('abł');
|
|
59
|
+
solve();
|
|
60
|
+
|
|
61
|
+
assertResult(0, 'bał', 14);
|
|
62
|
+
getResult(0).realHover();
|
|
63
|
+
getLoading().should('be.visible');
|
|
64
|
+
cy.wait('@dictionary');
|
|
65
|
+
getRackTile(0).parent().should('have.attr', 'role', 'mark');
|
|
66
|
+
getRackTile(1).parent().should('have.attr', 'role', 'mark');
|
|
67
|
+
getRackTile(2).parent().should('have.attr', 'role', 'mark');
|
|
68
|
+
getBoardTile(5, 7).should('have.value', 'b');
|
|
69
|
+
getBoardTile(6, 7).should('have.value', 'a');
|
|
70
|
+
getBoardTile(7, 7).should('have.value', 'ł');
|
|
71
|
+
getBoardTile(5, 7).parent().should('have.attr', 'role', 'mark');
|
|
72
|
+
getBoardTile(6, 7).parent().should('have.attr', 'role', 'mark');
|
|
73
|
+
getBoardTile(7, 7).parent().should('have.attr', 'role', 'mark');
|
|
74
|
+
getDictionaryInput().should('have.value', 'bał');
|
|
75
|
+
getLoading().should('not.exist');
|
|
76
|
+
getDictionaryTitles().should('have.length', 1).and('have.text', 'bał');
|
|
77
|
+
getDictionary()
|
|
78
|
+
.should('include.text', 'bać się')
|
|
79
|
+
.and('include.text', 'odczuwać lęk, strach')
|
|
80
|
+
.and('include.text', 'być niespokojnym o kogoś lub o coś')
|
|
81
|
+
.and('include.text', 'nie śmieć, nie odważać się na coś');
|
|
72
82
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
cy.findByLabelText('Punkty').realClick();
|
|
84
|
+
getTooltip().should('be.visible').and('have.text', 'Punkty');
|
|
85
|
+
assertResult(0, 'ba', 8);
|
|
86
|
+
getResult(0).realHover();
|
|
87
|
+
getRackTile(0).parent().should('have.attr', 'role', 'mark');
|
|
88
|
+
getRackTile(1).parent().should('have.attr', 'role', 'mark');
|
|
89
|
+
getRackTile(2).parent().should('not.have.attr', 'role', 'mark');
|
|
90
|
+
getBoardTile(5, 7).should('not.have.value');
|
|
91
|
+
getBoardTile(6, 7).should('have.value', 'b');
|
|
92
|
+
getBoardTile(7, 7).should('have.value', 'a');
|
|
93
|
+
getBoardTile(5, 7).parent().should('not.have.attr', 'role', 'mark');
|
|
94
|
+
getBoardTile(6, 7).parent().should('have.attr', 'role', 'mark');
|
|
95
|
+
getBoardTile(7, 7).parent().should('have.attr', 'role', 'mark');
|
|
96
|
+
getDictionaryInput().should('have.value', 'ba');
|
|
97
|
+
getLoading().should('be.visible');
|
|
98
|
+
cy.wait('@dictionary');
|
|
99
|
+
getLoading().should('not.exist');
|
|
100
|
+
getDictionaryTitles().should('have.length', 1).and('have.text', 'ba');
|
|
101
|
+
getDictionary()
|
|
102
|
+
.should('include.text', 'wykrzyknik, który wyraża głównie podziw, zdziwienie')
|
|
103
|
+
.and('include.text', 'w wierzeniach staroegipskich: dusza ludzka ginąca wraz z ciałem');
|
|
94
104
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
getResult(0).realClick();
|
|
106
|
+
getRackTile(0).parent().should('not.have.attr', 'role', 'mark');
|
|
107
|
+
getRackTile(1).parent().should('not.have.attr', 'role', 'mark');
|
|
108
|
+
getRackTile(2).parent().should('not.have.attr', 'role', 'mark');
|
|
109
|
+
getRackTile(0).should('not.have.value');
|
|
110
|
+
getRackTile(1).should('not.have.value');
|
|
111
|
+
getRackTile(2).should('have.value', 'ł');
|
|
112
|
+
getBoardTile(6, 7).should('have.value', 'b');
|
|
113
|
+
getBoardTile(7, 7).should('have.value', 'a');
|
|
104
114
|
|
|
105
|
-
|
|
115
|
+
cy.findByLabelText('Rozwiąż').should('be.visible').and('be.enabled');
|
|
116
|
+
});
|
|
106
117
|
});
|
|
107
118
|
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertResult,
|
|
3
|
+
closeModal,
|
|
4
|
+
getSettingOption,
|
|
5
|
+
getSettingsButton,
|
|
6
|
+
solve,
|
|
7
|
+
typeRack,
|
|
8
|
+
unregisterServiceWorkers,
|
|
9
|
+
visitIndex,
|
|
10
|
+
} from '../../support';
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* @see https://github.com/kamilmielnik/scrabble-solver/issues/112
|
|
14
|
+
*/
|
|
15
|
+
describe('#112 - Scrabble - Character bonus not applied', () => {
|
|
16
|
+
beforeEach(async () => {
|
|
17
|
+
await unregisterServiceWorkers();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
cy.clearLocalStorage();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('correctly shows points for a result which gets a character bonus', () => {
|
|
25
|
+
visitIndex();
|
|
26
|
+
|
|
27
|
+
getSettingsButton().realClick();
|
|
28
|
+
getSettingOption('Language', 'Français').check();
|
|
29
|
+
closeModal();
|
|
30
|
+
typeRack('jours');
|
|
31
|
+
solve();
|
|
32
|
+
|
|
33
|
+
assertResult(0, 'jours', 40);
|
|
34
|
+
assertResult(1, 'jours', 40);
|
|
35
|
+
assertResult(2, 'jours', 26);
|
|
36
|
+
assertResult(3, 'jours', 26);
|
|
37
|
+
assertResult(4, 'jours', 24);
|
|
38
|
+
assertResult(5, 'jours', 24);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { getModal, getSettingsButton, typeRack, unregisterServiceWorkers, visitIndex } from '../../support';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* @see https://github.com/kamilmielnik/scrabble-solver/issues/129
|
|
5
|
+
*/
|
|
6
|
+
describe('#129 - Esc does not close the sidebar when letters input is focused', () => {
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
await unregisterServiceWorkers();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
cy.clearLocalStorage();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('Esc key closes the sidebar when rack is focused', () => {
|
|
16
|
+
visitIndex();
|
|
17
|
+
getSettingsButton().realClick();
|
|
18
|
+
typeRack('a');
|
|
19
|
+
cy.realPress('Escape');
|
|
20
|
+
|
|
21
|
+
getModal().should('not.exist');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertResult,
|
|
3
|
+
getResults,
|
|
4
|
+
solve,
|
|
5
|
+
typeBoard,
|
|
6
|
+
typeRack,
|
|
7
|
+
unregisterServiceWorkers,
|
|
8
|
+
visitIndex,
|
|
9
|
+
} from '../../support';
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* @see https://github.com/kamilmielnik/scrabble-solver/issues/2
|
|
13
|
+
*/
|
|
14
|
+
describe('#2 - "Q" tile does not work', () => {
|
|
15
|
+
beforeEach(async () => {
|
|
16
|
+
await unregisterServiceWorkers();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
cy.clearLocalStorage();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('accepts "Q" tile in English', () => {
|
|
24
|
+
visitIndex();
|
|
25
|
+
typeBoard('i', 'horizontal', 7, 7);
|
|
26
|
+
typeRack('q');
|
|
27
|
+
solve();
|
|
28
|
+
|
|
29
|
+
getResults().should('have.length', 2);
|
|
30
|
+
assertResult(0, 'qi', 11);
|
|
31
|
+
assertResult(1, 'qi', 11);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
closeModal,
|
|
3
|
+
getSettingOption,
|
|
4
|
+
getSettingsButton,
|
|
5
|
+
typeBoard,
|
|
6
|
+
typeRack,
|
|
7
|
+
unregisterServiceWorkers,
|
|
8
|
+
visitIndex,
|
|
9
|
+
} from '../../support';
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* @see https://github.com/kamilmielnik/scrabble-solver/issues/3
|
|
13
|
+
*/
|
|
14
|
+
describe('#3 - "X" tile is allowed in Polish', () => {
|
|
15
|
+
beforeEach(async () => {
|
|
16
|
+
await unregisterServiceWorkers();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
cy.clearLocalStorage();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('does not accept "X" tile in Polish', () => {
|
|
24
|
+
visitIndex();
|
|
25
|
+
getSettingsButton().realClick();
|
|
26
|
+
getSettingOption('Language', 'Polski').check();
|
|
27
|
+
closeModal();
|
|
28
|
+
typeBoard('x', 'horizontal', 7, 7);
|
|
29
|
+
typeRack('x');
|
|
30
|
+
|
|
31
|
+
cy.findByText('x').should('not.exist');
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getSettingOption, getSettingsButton, unregisterServiceWorkers, visitIndex } from '../../support';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* @see https://github.com/kamilmielnik/scrabble-solver/issues/30
|
|
5
|
+
*/
|
|
6
|
+
describe('#30 - Clicking inside an icon of non-first unchecked radio button does not select that option', () => {
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
await unregisterServiceWorkers();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
cy.clearLocalStorage();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('Clicking inside an icon of first unchecked radio button selects it', () => {
|
|
16
|
+
visitIndex();
|
|
17
|
+
getSettingsButton().realClick();
|
|
18
|
+
getSettingOption('Language', 'English (GB)').click();
|
|
19
|
+
getSettingOption('Language', 'English (US)') // first unchecked radio button
|
|
20
|
+
.parent('label')
|
|
21
|
+
.findAllByRole('img', { hidden: true })
|
|
22
|
+
.first()
|
|
23
|
+
.realHover({ position: 'center' })
|
|
24
|
+
.realClick({ position: 'center' });
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getSettingOption, getSettingsButton, unregisterServiceWorkers, visitIndex } from '../../support';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* @see https://github.com/kamilmielnik/scrabble-solver/issues/333
|
|
5
|
+
*/
|
|
6
|
+
describe('#333 - Disabled radio button has cursor: pointer', () => {
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
await unregisterServiceWorkers();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
cy.clearLocalStorage();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('Disabled radio button has cursor: not-allowed', () => {
|
|
16
|
+
visitIndex();
|
|
17
|
+
getSettingsButton().realClick();
|
|
18
|
+
getSettingOption('Language', 'Polski').check();
|
|
19
|
+
getSettingOption('Gra', 'Scrabble').scrollIntoView();
|
|
20
|
+
|
|
21
|
+
getSettingOption('Gra', 'Super Scrabble').should('be.disabled');
|
|
22
|
+
getSettingOption('Gra', 'Super Scrabble').should('have.css', 'cursor', 'not-allowed');
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertResult,
|
|
3
|
+
closeModal,
|
|
4
|
+
getResult,
|
|
5
|
+
getResultsFilterInput,
|
|
6
|
+
getSettingOption,
|
|
7
|
+
getSettingsButton,
|
|
8
|
+
solve,
|
|
9
|
+
typeBoard,
|
|
10
|
+
typeRack,
|
|
11
|
+
unregisterServiceWorkers,
|
|
12
|
+
visitIndex,
|
|
13
|
+
} from '../../support';
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* @see https://github.com/kamilmielnik/scrabble-solver/issues/342
|
|
17
|
+
*/
|
|
18
|
+
describe('#342 - Incorrect sorting when filtering', () => {
|
|
19
|
+
beforeEach(async () => {
|
|
20
|
+
await unregisterServiceWorkers();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
afterEach(() => {
|
|
24
|
+
cy.clearLocalStorage();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('correctly sorts valid results first when text filter is active', () => {
|
|
28
|
+
visitIndex();
|
|
29
|
+
getSettingsButton().realClick();
|
|
30
|
+
getSettingOption('Language', 'Polski').check();
|
|
31
|
+
closeModal();
|
|
32
|
+
typeBoard('bopie', 'horizontal', 6, 3);
|
|
33
|
+
typeBoard('apu', 'vertical', 8, 4);
|
|
34
|
+
typeBoard('o', 'vertical', 10, 4);
|
|
35
|
+
typeRack('oe');
|
|
36
|
+
solve();
|
|
37
|
+
getResultsFilterInput().type('p');
|
|
38
|
+
|
|
39
|
+
assertResult(0, 'po', 5);
|
|
40
|
+
assertResult(1, 'pe', 5);
|
|
41
|
+
assertResult(2, 'op', 3);
|
|
42
|
+
assertResult(3, 'eo', 6);
|
|
43
|
+
getResult(0).should('not.have.attr', 'aria-hidden');
|
|
44
|
+
getResult(1).should('not.have.attr', 'aria-hidden');
|
|
45
|
+
getResult(2).should('not.have.attr', 'aria-hidden');
|
|
46
|
+
getResult(3).should('have.attr', 'aria-hidden', 'true');
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
closeModal,
|
|
3
|
+
getResult,
|
|
4
|
+
getSettingOption,
|
|
5
|
+
getSettingsButton,
|
|
6
|
+
solve,
|
|
7
|
+
typeRack,
|
|
8
|
+
unregisterServiceWorkers,
|
|
9
|
+
visitIndex,
|
|
10
|
+
} from '../../support';
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* @see https://github.com/kamilmielnik/scrabble-solver/issues/348
|
|
14
|
+
*/
|
|
15
|
+
describe('#348 - Missing result word padding when coordinates are not shown', () => {
|
|
16
|
+
beforeEach(async () => {
|
|
17
|
+
await unregisterServiceWorkers();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
cy.clearLocalStorage();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('sets proper padding on result cells depending on coordinates setting (LTR language)', () => {
|
|
25
|
+
visitIndex();
|
|
26
|
+
typeRack('ab');
|
|
27
|
+
solve();
|
|
28
|
+
|
|
29
|
+
getResult(0).then(([$result]) => {
|
|
30
|
+
const $span = $result.children[0];
|
|
31
|
+
const wordCell = $span.children[0];
|
|
32
|
+
|
|
33
|
+
expect(window.getComputedStyle(wordCell).paddingLeft).to.equal('15px');
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
getSettingsButton().realClick();
|
|
37
|
+
getSettingOption('Coordinates', 'Original').check();
|
|
38
|
+
closeModal();
|
|
39
|
+
|
|
40
|
+
getResult(0).then(([$result]) => {
|
|
41
|
+
const $span = $result.children[0];
|
|
42
|
+
const wordCell = $span.children[1];
|
|
43
|
+
|
|
44
|
+
expect(window.getComputedStyle(wordCell).paddingLeft).to.equal('15px');
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('sets proper padding on result cells depending on coordinates setting (RTL language)', () => {
|
|
49
|
+
visitIndex();
|
|
50
|
+
getSettingsButton().realClick();
|
|
51
|
+
getSettingOption('Language', 'فارسی').check();
|
|
52
|
+
closeModal();
|
|
53
|
+
typeRack('فا');
|
|
54
|
+
solve();
|
|
55
|
+
|
|
56
|
+
getResult(0).then(([$result]) => {
|
|
57
|
+
const $span = $result.children[0];
|
|
58
|
+
const wordCell = $span.children[0];
|
|
59
|
+
|
|
60
|
+
expect(window.getComputedStyle(wordCell).paddingRight).to.equal('15px');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
getSettingsButton().realClick();
|
|
64
|
+
getSettingOption('مختصات', 'إبداعي').check();
|
|
65
|
+
closeModal();
|
|
66
|
+
|
|
67
|
+
getResult(0).then(([$result]) => {
|
|
68
|
+
const $span = $result.children[0];
|
|
69
|
+
const wordCell = $span.children[1];
|
|
70
|
+
|
|
71
|
+
expect(window.getComputedStyle(wordCell).paddingRight).to.equal('15px');
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './bugs/2-q-tile-in-english';
|
|
2
|
+
import './bugs/3-x-tile-in-polish';
|
|
3
|
+
import './bugs/112-character-bonus';
|
|
4
|
+
import './bugs/129-esc-sidebar';
|
|
5
|
+
import './bugs/30-click-inside-radio-icon';
|
|
6
|
+
import './bugs/333-disabled-radio-cursor';
|
|
7
|
+
import './bugs/342-results-sorting';
|
|
8
|
+
import './bugs/348-results-word-padding';
|
package/lerna.json
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scrabble-solver",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"description": "Scrabble Solver 2 - Free, open-source, cross-platform, and multi-language analysis tool for Scrabble, Super Scrabble & Literaki. Quickly find top scoring words using given board & tiles.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Scrabble",
|
|
7
7
|
"Super Scrabble",
|
|
8
|
+
"Kelimelik",
|
|
8
9
|
"Literaki",
|
|
9
10
|
"Solver",
|
|
10
11
|
"Finder",
|
|
@@ -12,11 +13,19 @@
|
|
|
12
13
|
"Word",
|
|
13
14
|
"English",
|
|
14
15
|
"Français",
|
|
16
|
+
"French",
|
|
15
17
|
"Deutsch",
|
|
18
|
+
"German",
|
|
16
19
|
"Polski",
|
|
17
|
-
"
|
|
20
|
+
"Polish",
|
|
21
|
+
"فارسی",
|
|
18
22
|
"Farsi",
|
|
23
|
+
"Español",
|
|
24
|
+
"Spanish",
|
|
19
25
|
"Română",
|
|
26
|
+
"Romanian",
|
|
27
|
+
"Türkçe",
|
|
28
|
+
"Turkish",
|
|
20
29
|
"SOWPODS",
|
|
21
30
|
"TWL06",
|
|
22
31
|
"SJP",
|
|
@@ -84,36 +93,36 @@
|
|
|
84
93
|
"packages/scrabble-solver"
|
|
85
94
|
],
|
|
86
95
|
"dependencies": {
|
|
87
|
-
"@scrabble-solver/scrabble-solver": "^2.
|
|
96
|
+
"@scrabble-solver/scrabble-solver": "^2.15.0",
|
|
88
97
|
"concurrently": "^8.2.2",
|
|
89
98
|
"open-cli": "^8.0.0"
|
|
90
99
|
},
|
|
91
100
|
"devDependencies": {
|
|
92
|
-
"@babel/core": "^7.
|
|
101
|
+
"@babel/core": "^7.25.2",
|
|
93
102
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
94
|
-
"@babel/preset-env": "^7.
|
|
103
|
+
"@babel/preset-env": "^7.25.3",
|
|
95
104
|
"@testing-library/cypress": "^10.0.2",
|
|
96
105
|
"@types/jest": "^29.5.12",
|
|
97
106
|
"@types/node": "^20.14.10",
|
|
98
107
|
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
99
108
|
"@typescript-eslint/parser": "^7.16.0",
|
|
100
|
-
"cypress": "^13.13.
|
|
109
|
+
"cypress": "^13.13.2",
|
|
101
110
|
"cypress-real-events": "^1.13.0",
|
|
102
111
|
"eslint": "^8.57.0",
|
|
103
112
|
"eslint-config-prettier": "^9.1.0",
|
|
104
113
|
"eslint-import-resolver-node": "^0.3.9",
|
|
105
|
-
"eslint-plugin-cypress": "^3.
|
|
114
|
+
"eslint-plugin-cypress": "^3.4.0",
|
|
106
115
|
"eslint-plugin-import": "^2.29.1",
|
|
107
|
-
"eslint-plugin-mocha": "^10.
|
|
108
|
-
"eslint-plugin-prettier": "^5.1
|
|
109
|
-
"eslint-plugin-react": "^7.
|
|
116
|
+
"eslint-plugin-mocha": "^10.5.0",
|
|
117
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
118
|
+
"eslint-plugin-react": "^7.35.0",
|
|
110
119
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
111
120
|
"jest": "29.7.0",
|
|
112
|
-
"lerna": "^8.1.
|
|
113
|
-
"np": "^10.0.
|
|
114
|
-
"prettier": "^3.3.
|
|
121
|
+
"lerna": "^8.1.7",
|
|
122
|
+
"np": "^10.0.7",
|
|
123
|
+
"prettier": "^3.3.3",
|
|
115
124
|
"rimraf": "^6.0.1",
|
|
116
|
-
"ts-jest": "^29.2.
|
|
117
|
-
"typescript": "^5.5.
|
|
125
|
+
"ts-jest": "^29.2.4",
|
|
126
|
+
"typescript": "^5.5.4"
|
|
118
127
|
}
|
|
119
128
|
}
|