Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix App tests #675

Draft
wants to merge 3 commits into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 13 additions & 1 deletion src/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
import React from 'react';

import { JSNS } from '@zextras/carbonio-shell-ui';
import * as shellUi from '@zextras/carbonio-shell-ui';
import { HttpResponse } from 'msw';
import { act } from 'react-dom/test-utils';
Expand All @@ -13,6 +14,11 @@ import App from './app';
import * as addComponentsToShell from './app-utils/add-shell-components';
import * as registerShellActions from './app-utils/register-shell-actions';
import * as registerShellIntegrations from './app-utils/register-shell-integrations';
import {
GetShareInfoRequest,
GetShareInfoResponse
} from './carbonio-ui-commons/soap/get-share-info';
import { generateFolder } from './carbonio-ui-commons/test/mocks/folders/folders-generator';
import {
createAPIInterceptor,
createSoapAPIInterceptor
Expand Down Expand Up @@ -58,7 +64,13 @@ describe('App', () => {

beforeEach(() => {
createAPIInterceptor('get', 'zx/login/v3/account', HttpResponse.json({}));
createSoapAPIInterceptor('GetFolder', HttpResponse.json({}));
createSoapAPIInterceptor('GetFolder', {
folder: [{}]
});
createSoapAPIInterceptor<GetShareInfoRequest, GetShareInfoResponse>('GetShareInfo', {
_jsns: JSNS.account,
share: [generateFolder()]
});
jest.clearAllMocks();
});

Expand Down