Skip to content

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

chore: hardening tests for adding description to files and folders

Ilian Sapundshiev378bec313c82
diff --git a/tests/e2e/fileopener.pw.e2e.js b/tests/e2e/fileopener.pw.e2e.js
index d0bea4e05..8c9361c7c 100644
--- a/tests/e2e/fileopener.pw.e2e.js
+++ b/tests/e2e/fileopener.pw.e2e.js
@@ -271,7 +271,7 @@ test.describe('TST08 - File folder properties', () => {
/**
* Description is Pro feature (if no Pro editDescription button is disabled)
*/
- test('TST3001 - Description for files [web,s3,electron,_pro]', async () => {
+ test('TST3001 - Description for files [web,s3,electron]', async () => {
const desc = 'testDescription';
// open fileProperties
await openFile('sample.pdf');
@@ -284,11 +284,6 @@ test.describe('TST08 - File folder properties', () => {
);
});
- /**
- * duplicate TST0213
- */
- test.skip('TST3005 - Description for folders [Pro]', async () => {});
-
/**
* reload file button failed on web windows only but the problem is in test only
*/
diff --git a/tests/e2e/folderprops.pw.e2e.js b/tests/e2e/folderprops.pw.e2e.js
index 414ee75ac..454f9ef3a 100644
--- a/tests/e2e/folderprops.pw.e2e.js
+++ b/tests/e2e/folderprops.pw.e2e.js
@@ -227,7 +227,7 @@ test.describe('TST02 - Folder properties', () => {
await testDataRefresh(isS3, testDataDir);
});
- test('TST0213 - Add description to folder [web,s3,electron,_pro]', async () => {
+ test('TST0213 - Add description to folder [web,s3,electron]', async () => {
await addDescription('testDescription');
await expectElementExist(
'[data-tid=gridCellDescription]',
diff --git a/tests/e2e/general.helpers.js b/tests/e2e/general.helpers.js
index 745efbcc1..bd8776fb8 100644
--- a/tests/e2e/general.helpers.js
+++ b/tests/e2e/general.helpers.js
@@ -986,6 +986,11 @@ export async function addDescription(desc) {
} catch (e) {
await editor.type(desc);
}
+ // The editor pushes the typed markdown into React state via an async
+ // `markdownUpdated` listener. Saving before that state update propagates
+ // makes `saveDescription()` persist the stale (empty) description, so wait
+ // for the "changed" marker to appear before clicking save.
+ await expectElementExist('[data-tid=descriptionChangedTID]', true, 8000);
await clickOn('[data-tid=saveDescriptionTID]');
}