Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix TST0632

sytolkc687e38b67f1
diff --git a/tests/e2e/hook.js b/tests/e2e/hook.js
index 05afa801e..25aec7843 100644
--- a/tests/e2e/hook.js
+++ b/tests/e2e/hook.js
@@ -193,7 +193,7 @@ export async function testDataRefresh() {
}*/
}
-export async function createEmptyFile() {
+export async function createEmptyFile(fileName = 'empty_file.html') {
const file = pathLib.join(
__dirname,
'..',
@@ -201,7 +201,7 @@ export async function createEmptyFile() {
'file-structure',
'supported-filestypes',
'empty_folder',
- 'empty_file.html'
+ fileName
);
try {
diff --git a/tests/e2e/search.pw.e2e.js b/tests/e2e/search.pw.e2e.js
index 076283502..891e19b6d 100644
--- a/tests/e2e/search.pw.e2e.js
+++ b/tests/e2e/search.pw.e2e.js
@@ -301,13 +301,29 @@ test.describe('TST06 - Test Search in file structure:', () => {
await expectElementExist(getGridFileSelector('sample.pdf'), true, 5000);
});
- // TODO handle 3 cases with better key words
test('TST0632 - Search q. comp - accuracy (fuzzy, semi strict, strict) [web,electron]', async () => {
+ await createEmptyFile('n1ote.txt');
+ await createEmptyFile('note.txt');
+ // fuzzy
await addSearchCommand('a:', false);
- // choose option Today
await clickOn('#textQuery-option-0');
- await addSearchCommand('txt', true);
- await expectElementExist(getGridFileSelector('sample.pdf'), true, 5000);
+ await addSearchCommand('n1te', true);
+ await expectElementExist(getGridFileSelector('n1ote.txt'), true, 5000);
+ await expectElementExist(getGridFileSelector('note.txt'), true, 5000);
+ await clickOn('#clearSearchID');
+ // semi strict
+ await addSearchCommand('a:', false);
+ await clickOn('#textQuery-option-1');
+ await addSearchCommand('note', true);
+ await expectElementExist(getGridFileSelector('n1ote.txt'), false, 5000);
+ await expectElementExist(getGridFileSelector('note.txt'), true, 5000);
+ await clickOn('#clearSearchID');
+ // strict
+ await addSearchCommand('a:', false);
+ await clickOn('#textQuery-option-1');
+ await addSearchCommand('note', true);
+ await expectElementExist(getGridFileSelector('n1ote.txt'), false, 5000);
+ await expectElementExist(getGridFileSelector('note.txt'), true, 5000);
});
test('TST0642 - Add/Remove sidecar tags in search results [web,electron]', async () => {