Skip to content

Commit

Permalink
test: fix pinned tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-Torrent committed Jan 13, 2022
1 parent b5af0eb commit a292e96
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
42 changes: 22 additions & 20 deletions cypress/fixtures/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,29 +619,31 @@ export const HIDDEN_ITEM = {
],
};

export const PINNED_ITEM = {
...DEFAULT_FOLDER_ITEM,
id: 'ecafbd2a-5688-11eb-ae93-0242ac130002',
name: 'parent public item',
path: 'ecafbd2a_5688_11eb_ae93_0242ac130002',
extra: {
image: 'someimageurl',
},
settings: {
isPinned: true,
showChatbox: true,
},
memberships: [
{
itemPath: 'fdf09f5a_5688_11eb_ae93_0242ac130002',
permission: PERMISSION_LEVELS.ADMIN,
memberId: MEMBERS.ANNA.id,
},
],
};

export const ITEMS_SETTINGS = {
items: [
HIDDEN_ITEM,
{
...DEFAULT_FOLDER_ITEM,
id: 'ecafbd2a-5688-11eb-ae93-0242ac130002',
name: 'parent public item',
path: 'ecafbd2a_5688_11eb_ae93_0242ac130002',
extra: {
image: 'someimageurl',
},
settings: {
isPinned: true,
showChatbox: true,
},
memberships: [
{
itemPath: 'fdf09f5a_5688_11eb_ae93_0242ac130002',
permission: PERMISSION_LEVELS.ADMIN,
memberId: MEMBERS.ANNA.id,
},
],
},
PINNED_ITEM,
{
...DEFAULT_FOLDER_ITEM,
id: 'ecafbd2a-5688-11eb-ae93-0242ac130003',
Expand Down
10 changes: 5 additions & 5 deletions cypress/integration/item/pin/pinItem.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ITEMS_SETTINGS } from '../../../fixtures/items';
import { ITEMS_SETTINGS, PINNED_ITEM } from '../../../fixtures/items';
import { HOME_PATH } from '../../../../src/config/paths';
import {
buildItemCard,
Expand Down Expand Up @@ -28,7 +28,7 @@ describe('Pinning Item', () => {
});

it('Pin an item', () => {
const item = ITEMS_SETTINGS.items[1];
const item = ITEMS_SETTINGS.items[0];

togglePinButton(item.id);

Expand All @@ -44,7 +44,7 @@ describe('Pinning Item', () => {
});

it('Unpin Item', () => {
const item = ITEMS_SETTINGS.items[1];
const item = PINNED_ITEM;

togglePinButton(item.id);

Expand All @@ -68,7 +68,7 @@ describe('Pinning Item', () => {
});

it('Pin an item', () => {
const item = ITEMS_SETTINGS.items[1];
const item = ITEMS_SETTINGS.items[0];

togglePinButtonCard(item.id);

Expand All @@ -84,7 +84,7 @@ describe('Pinning Item', () => {
});

it('Unpin Item', () => {
const item = ITEMS_SETTINGS.items[1];
const item = PINNED_ITEM;

togglePinButtonCard(item.id);

Expand Down

0 comments on commit a292e96

Please sign in to comment.