Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
fix: selectors for icons in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Aug 22, 2024
1 parent b1c8ce5 commit 7890b64
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions cypress/e2e/item/move/move.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { HOME_PATH, buildItemPath } from '../../../../src/config/paths';
import {
ITEM_MENU_MOVE_BUTTON_CLASS,
MOVE_MANY_ITEMS_BUTTON_SELECTOR,
MY_GRAASP_ITEM_PATH,
buildItemsGridMoreButtonSelector,
buildNavigationModalItemId,
} from '../../../../src/config/selectors';
Expand Down Expand Up @@ -123,7 +122,7 @@ describe('Move Items', () => {

// move
const { id: movedItem } = CHILD;
moveItem({ id: movedItem, toItemPath: MY_GRAASP_ITEM_PATH });
moveItem({ id: movedItem, toItemPath: '' });

cy.wait('@moveItems').then(({ request: { body, url } }) => {
expect(body.parentId).to.equal(undefined);
Expand Down
3 changes: 2 additions & 1 deletion cypress/e2e/item/trash/delete.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { PackedRecycledItemDataFactory } from '@graasp/sdk';
import { RECYCLE_BIN_PATH } from '../../../../src/config/paths';
import {
CONFIRM_DELETE_BUTTON_ID,
DELETE_SINGLE_ITEM_BUTTON_SELECTOR,
RECYCLE_BIN_DELETE_MANY_ITEMS_BUTTON_ID,
buildItemCard,
} from '../../../../src/config/selectors';

const deleteItem = (id: string) => {
cy.get(`#${buildItemCard(id)} [data-testid="DeleteIcon"]`).click();
cy.get(`#${buildItemCard(id)} ${DELETE_SINGLE_ITEM_BUTTON_SELECTOR}`).click();
cy.get(`#${CONFIRM_DELETE_BUTTON_ID}`).click();
};

Expand Down
6 changes: 3 additions & 3 deletions src/config/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,8 @@ export const SORTING_SELECT_SELECTOR_TEST_ID = 'sortingSelect';
export const SORTING_SELECT_SELECTOR = `[data-testid="${SORTING_SELECT_SELECTOR_TEST_ID}"]`;
export const SORTING_ORDERING_SELECTOR_DESC = '.lucide-arrow-up-wide-narrow';
export const SORTING_ORDERING_SELECTOR_ASC = '.lucide-arrow-down-narrow-wide';
export const UNBOOKMARK_ICON_SELECTOR = '[data-testid="BookmarkIcon"]';
export const BOOKMARK_ICON_SELECTOR =
'[data-testid="BookmarkBorderOutlinedIcon"]';
export const UNBOOKMARK_ICON_SELECTOR = '.lucide-bookmark';
export const BOOKMARK_ICON_SELECTOR = '.lucide-bookmark';

export const MEMBER_VALIDATION_BANNER_ID = 'memberValidationBanner';
export const MEMBER_VALIDATION_BANNER_CLOSE_BUTTON_ID =
Expand All @@ -434,3 +433,4 @@ export const RECYCLE_BIN_RESTORE_MANY_ITEMS_BUTTON_ID =
'recycleBinRestoreManyButton';
export const COPY_MANY_ITEMS_BUTTON_SELECTOR = `.lucide-copy`;
export const MOVE_MANY_ITEMS_BUTTON_SELECTOR = `.lucide-move`;
export const DELETE_SINGLE_ITEM_BUTTON_SELECTOR = `.lucide-trash`;

0 comments on commit 7890b64

Please sign in to comment.