2020-04-10 16:32:37 +01:00
|
|
|
import {render} from '@testing-library/react';
|
2020-09-23 23:29:16 +05:30
|
|
|
import {site} from './utils/fixtures';
|
2020-03-24 18:37:04 +05:30
|
|
|
import App from './App';
|
|
|
|
|
2023-07-27 09:49:51 +02:00
|
|
|
const setup = async () => {
|
2020-06-12 13:51:00 +05:30
|
|
|
const testState = {
|
|
|
|
site,
|
2020-09-23 20:37:59 +05:30
|
|
|
member: null,
|
2020-06-12 13:51:00 +05:30
|
|
|
action: 'init:success',
|
2020-07-07 19:53:26 +05:30
|
|
|
brandColor: site.accent_color,
|
2020-06-12 13:51:00 +05:30
|
|
|
page: 'signup',
|
|
|
|
initStatus: 'success',
|
|
|
|
showPopup: true
|
|
|
|
};
|
|
|
|
const {...utils} = render(
|
|
|
|
<App testState={testState} />
|
2020-04-15 21:15:56 +05:30
|
|
|
);
|
2022-02-14 23:27:16 +05:30
|
|
|
|
|
|
|
const triggerButtonFrame = await utils.findByTitle(/portal-trigger/i);
|
|
|
|
const popupFrame = await utils.findByTitle(/portal-popup/i);
|
2020-06-12 13:51:00 +05:30
|
|
|
return {
|
|
|
|
popupFrame,
|
|
|
|
triggerButtonFrame,
|
|
|
|
...utils
|
|
|
|
};
|
|
|
|
};
|
2020-04-15 21:15:56 +05:30
|
|
|
|
2022-02-14 23:27:16 +05:30
|
|
|
describe.skip('App', () => {
|
|
|
|
test('renders popup and trigger frames', async () => {
|
|
|
|
const {popupFrame, triggerButtonFrame} = await setup();
|
2020-06-12 13:51:00 +05:30
|
|
|
|
|
|
|
expect(popupFrame).toBeInTheDocument();
|
|
|
|
expect(triggerButtonFrame).toBeInTheDocument();
|
|
|
|
});
|
2022-02-14 23:27:16 +05:30
|
|
|
});
|