Skip to content

Commit

Permalink
add e2e TST0219 TST0220
Browse files Browse the repository at this point in the history
  • Loading branch information
sytolk committed Mar 12, 2024
1 parent 3de13ac commit b1adf11
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/renderer/components/EntryProperties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,11 @@ function EntryProperties(props: Props) {
!openedEntry.editMode &&
editName === undefined && (
<ProTooltip tooltip={t('changeThumbnail')}>
<Button fullWidth onClick={toggleThumbFilesDialog}>
<Button
data-tid="changeThumbnailTID"
fullWidth
onClick={toggleThumbFilesDialog}
>
{t('core:change')}
</Button>
{/* <IconButton
Expand Down Expand Up @@ -1023,7 +1027,11 @@ function EntryProperties(props: Props) {
!openedEntry.editMode &&
editName === undefined && (
<ProTooltip tooltip={t('changeBackgroundImage')}>
<Button fullWidth onClick={toggleBgndImgDialog}>
<Button
data-tid="changeBackgroundImageTID"
fullWidth
onClick={toggleBgndImgDialog}
>
{t('core:change')}
</Button>
{/* <IconButton
Expand All @@ -1037,8 +1045,8 @@ function EntryProperties(props: Props) {
</IconButton> */}
</ProTooltip>
)}
{/* <ProTooltip tooltip={t('changeBackgroundImage')}> */}
<div
data-tid="propsBgnImageTID"
role="button"
tabIndex={0}
style={{
Expand All @@ -1059,7 +1067,6 @@ function EntryProperties(props: Props) {
}}
onClick={toggleBgndImgDialog}
/>
{/* </ProTooltip> */}
</Stack>
</InputAdornment>
),
Expand Down
38 changes: 38 additions & 0 deletions tests/e2e/folderprops.pw.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,42 @@ test.describe('TST02 - Folder properties', () => {
5000,
);
});

test('TST0219 - Set and remove predefined folder thumbnail [web,minio,electron,_pro]', async () => {
await openContextEntryMenu(
getGridFileSelector('empty_folder'),
'showProperties',
);
await clickOn('[data-tid=changeThumbnailTID]');
await clickOn('ul[data-tid=predefinedThumbnailsTID] > li');
await clickOn('[data-tid=confirmCustomThumb]');

const imgElement = await global.client.$(
'[data-tid=fsEntryName_empty_folder] img',
);
const srcValue = await imgElement.getAttribute('src');
expect(srcValue.indexOf('.ts/tst.jpg')).toBeGreaterThan(-1);
});

test('TST0220 - Set and remove predefined folder background [web,minio,electron,_pro]', async () => {
await openContextEntryMenu(
getGridFileSelector('empty_folder'),
'openDirectory',
);
await clickOn('[data-tid=changeBackgroundImageTID]');
await clickOn('ul[data-tid=predefinedBackgroundsTID] > li');

await expectElementExist(
'[data-tid=bgnColorPickerDialogContent] > img',
true,
5000,
);
await clickOn('[data-tid=colorPickerConfirm]');
// todo expects - background link is always the same
/*const imgElement = await global.client.$(
'[data-tid=propsBgnImageTID]',
);
const styleValue = await imgElement.getAttribute('style');
expect(styleValue.indexOf('.ts/tsb.jpg')).toBeGreaterThan(-1);*/
});
});

0 comments on commit b1adf11

Please sign in to comment.