Skip to content

Commit

Permalink
test(fix): adapt tests to query-client update
Browse files Browse the repository at this point in the history
  • Loading branch information
swouf committed Jan 24, 2023
1 parent bcf488f commit 54f6592
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 5 additions & 1 deletion cypress/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ declare global {
database?: Partial<Database>;
currentMember?: Member;
appContext?: Partial<LocalContext>;
errors?: object;
errors?:
| {
deleteAppDataShouldThrow?: boolean | undefined;
}
| undefined;
}): Chainable<Element>;
}
}
Expand Down
5 changes: 4 additions & 1 deletion cypress/fixtures/appData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { v4 } from 'uuid';

import { AppData } from '@graasp/apps-query-client';

import { APP_DATA_TYPES } from '../../src/config/constants';
import { APP_DATA_TYPES } from '../../src/config/appDataTypes';
import { AppDataVisibility } from '../../src/types/appData';
import { CURRENT_MEMBER, MEMBERS } from './members';
import { MOCK_SERVER_ITEM } from './mockItem';

Expand All @@ -27,6 +28,7 @@ export const MOCK_APP_DATA: AppData = {
createdAt: new Date('2020-01-01').toISOString(),
updatedAt: new Date('2020-01-01').toISOString(),
type: APP_DATA_TYPES.FILE,
visibility: AppDataVisibility.MEMBER,
};

const mockAppDataId2 = v4();
Expand All @@ -45,4 +47,5 @@ export const MOCK_STUDENT_APP_DATA: AppData = {
createdAt: new Date('2020-01-01').toISOString(),
updatedAt: new Date('2020-01-01').toISOString(),
type: APP_DATA_TYPES.FILE,
visibility: AppDataVisibility.MEMBER,
};
5 changes: 0 additions & 5 deletions cypress/support/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ export const deleteFile = ({ id }): void => {
cy.get(`#${CONFIRM_DELETE_BUTTON_ID}`).click();
};

// interface checkRowInt {
// _: AppData;
// checkMember?: boolean;
// }

export const checkRow = (
{ id, createdAt, data: { name }, creator }: AppData,
checkMember = false,
Expand Down

0 comments on commit 54f6592

Please sign in to comment.