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

feat: show delete item login schema alert to permanently remove data #1577

Merged
merged 5 commits into from
Nov 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: fix test
  • Loading branch information
pyphilia committed Nov 28, 2024
commit de36f65f2814282856edebfba87a53501e2cb5f8
35 changes: 23 additions & 12 deletions cypress/e2e/item/share/changeVisibility.cy.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {
GuestFactory,
ItemLoginSchemaStatus,
ItemLoginSchemaType,
ItemVisibilityType,
PackedFolderItemFactory,
PermissionLevel,
PublicationStatus,
} from '@graasp/sdk';

Expand All @@ -18,6 +20,8 @@ import {
buildShareButtonId,
} from '../../../../src/config/selectors';
import { PublishedItemFactory } from '../../../fixtures/items';
import { buildItemMembership } from '../../../fixtures/memberships';
import { addItemLoginSchema } from '../authorization/itemLogin/utils';

const changeVisibility = (value: string): void => {
cy.get(`#${SHARE_ITEM_VISIBILITY_SELECT_ID}`).click();
Expand Down Expand Up @@ -103,18 +107,25 @@ describe('Visibility of an Item', () => {
});

it('Change Pseudonymized Item to Private Item with guest', () => {
const item = PackedFolderItemFactory();
const ITEM_LOGIN_ITEM = {
...item,
itemLoginSchema: {
item,
type: ItemLoginSchemaType.Username,
id: 'efaf3d5a-5688-11eb-ae93-0242ac130002',
createdAt: '2021-08-11T12:56:36.834Z',
updatedAt: '2021-08-11T12:56:36.834Z',
},
};
cy.setUpApi({ items: [ITEM_LOGIN_ITEM] });
const item = addItemLoginSchema(
PackedFolderItemFactory({}),
ItemLoginSchemaType.Username,
);
const guest = GuestFactory({ itemLoginSchema: item.itemLoginSchema });
cy.setUpApi({
items: [
{
...item,
memberships: [
buildItemMembership({
item,
account: guest,
permission: PermissionLevel.Read,
}),
],
},
],
});
cy.visit(buildItemPath(item.id));
cy.get(`#${buildShareButtonId(item.id)}`).click();

Expand Down