Skip to content

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

fix: tests due to change perspective implementation

Ilian Sapundshievddfd70e744d6
diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsx
index d072e213f..5f109dca2 100644
--- a/app/components/FolderContainer.tsx
+++ b/app/components/FolderContainer.tsx
@@ -497,6 +497,7 @@ const FolderContainer = (props: Props) => {
<ToggleButton
value={perspective.id}
aria-label={perspective.id}
+ data-tid={perspective.key}
onClick={() => switchPerspective(perspective.id)}
>
<Tooltip arrow title={perspective.title}>
diff --git a/tests/e2e/general.helpers.js b/tests/e2e/general.helpers.js
index bf697ef1d..3f43b6326 100644
--- a/tests/e2e/general.helpers.js
+++ b/tests/e2e/general.helpers.js
@@ -464,7 +464,7 @@ export async function selectAllFiles() {
}
export async function selectFilesByID(arrEntryIds = []) {
- await clickOn('[data-tid=gridPerspectiveSwitchLayoutToRow]');
+ await clickOn('[data-tid=openListPerspective]');
for (let i = 0; i < arrEntryIds.length; i++) {
await clickOn(
'div[data-entry-id="' + arrEntryIds[i] + '"] div[data-tid=rowCellTID]'
@@ -475,7 +475,7 @@ export async function selectFilesByID(arrEntryIds = []) {
entry = await entry.$('[data-tid=rowCellTID]');
await entry.click();*/
}
- await clickOn('[data-tid=gridPerspectiveSwitchLayoutToGrid]');
+ await clickOn('[data-tid=openDefaultPerspective]');
}
/**
@@ -484,7 +484,7 @@ export async function selectFilesByID(arrEntryIds = []) {
* @returns {Promise<*>}
*/
export async function selectRowFiles(arrIndex = []) {
- await clickOn('[data-tid=gridPerspectiveSwitchLayoutToRow]');
+ await clickOn('[data-tid=openListPerspective]');
// const filesList = await global.client.$('[data-tid=perspectiveGridFileTable]');
const filesList = await global.client.$$('[data-tid=rowCellTID]');
const arrElements = [];
@@ -523,7 +523,7 @@ export async function selectRowFiles(arrIndex = []) {
}
}
}
- await clickOn('[data-tid=gridPerspectiveSwitchLayoutToGrid]');
+ await clickOn('[data-tid=openDefaultPerspective]');
return arrElements;
}
diff --git a/tests/e2e/perspective-grid-right-button.e2e.js b/tests/e2e/perspective-grid-right-button.e2e.js
index fd27a1434..64b8fb086 100644
--- a/tests/e2e/perspective-grid-right-button.e2e.js
+++ b/tests/e2e/perspective-grid-right-button.e2e.js
@@ -427,7 +427,7 @@ describe('TST50** - Right button on a file', () => {
'grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));'
);
- await clickOn('[data-tid=gridPerspectiveSwitchLayoutToRow]');
+ await clickOn('[data-tid=openListPerspective]');
// check perspective view
gridStyle = await grid.getAttribute('style');
diff --git a/tests/e2e/perspective-grid-right-button.pw.e2e.js b/tests/e2e/perspective-grid-right-button.pw.e2e.js
index 171d8c1c8..d6a90d19f 100644
--- a/tests/e2e/perspective-grid-right-button.pw.e2e.js
+++ b/tests/e2e/perspective-grid-right-button.pw.e2e.js
@@ -448,7 +448,7 @@ describe('TST50** - Right button on a file', () => {
'margin-top: 53px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));'
);
- await clickOn('[data-tid=gridPerspectiveSwitchLayoutToRow]');
+ await clickOn('[data-tid=openListPerspective]');
// check perspective view
gridStyle = await grid.getAttribute('style');