revert test files to default
This commit is contained in:
@@ -1,53 +1,13 @@
|
||||
import React from 'react';
|
||||
// import { Provider } from 'react-redux';
|
||||
// import { fireEvent, render, screen } from '@testing-library/react-native';
|
||||
// import store from '../state/Store';
|
||||
import { Provider } from 'react-redux';
|
||||
import TestRenderer from 'react-test-renderer';
|
||||
import store from '../state/Store';
|
||||
|
||||
import AuthenticationView from '../views/AuthenticationView';
|
||||
// import { en, fr } from '../i18n/Translations';
|
||||
// import { useLanguage } from '../state/LanguageSlice';
|
||||
import renderer from 'react-test-renderer'
|
||||
import { NativeBaseProvider } from "native-base";
|
||||
import Theme from '../Theme';
|
||||
// import { setUserToken } from '../state/UserSlice';
|
||||
|
||||
describe('AuthenticationView Component', () => {
|
||||
|
||||
jest.setTimeout(150000);
|
||||
const view = () => <NativeBaseProvider theme={Theme}><AuthenticationView/></NativeBaseProvider>;
|
||||
// beforeEach(() => render(view()));
|
||||
|
||||
|
||||
it('view should render', () => {
|
||||
const tree = renderer.create(view()).toJSON;
|
||||
expect(tree).toMatchSnapshot();
|
||||
// expect(screen).toBeDefined();
|
||||
describe('<AuthenticationView />', () => {
|
||||
it('has 3 children', () => {
|
||||
const tree = TestRenderer.create(<Provider store={store}><AuthenticationView /></Provider>).toJSON();
|
||||
expect(tree.children.length).toBe(3);
|
||||
});
|
||||
|
||||
|
||||
// it('should fail', () => {
|
||||
// expect(AuthenticationView.)
|
||||
// });
|
||||
|
||||
// it('should render forms', async () => {
|
||||
// expect(await screen.findByDisplayValue('username')).toBeTruthy();
|
||||
// });
|
||||
// it('renders the submit button', () => {
|
||||
// expect(screen.findAllByText('en.signinBtn')).toBeTruthy();
|
||||
// });
|
||||
// it('renders the forms', async () => {
|
||||
// expect(screen.findAllByPlaceholderText)
|
||||
// })
|
||||
// const view = () => <Provider store={store}><AuthenticationView /></Provider>;
|
||||
|
||||
// beforeEach(() => render(view()));
|
||||
|
||||
// it('has should display the text in default language', async () => {
|
||||
// expect((await screen.findAllByText(en.signinBtn)).length).toBe(true);
|
||||
// });
|
||||
|
||||
// it('has should display the text in the new language', async () => {
|
||||
// store.dispatch(useLanguage('fr'));
|
||||
// screen.update(view());
|
||||
// expect("(await screen.findAllByText(fr.signinBtn)").toBe(true);
|
||||
// });
|
||||
});
|
||||
@@ -1,40 +1,13 @@
|
||||
import React from 'react';
|
||||
// import { Provider } from 'react-redux';
|
||||
// import store from '../state/Store';
|
||||
// import { fireEvent, render, screen } from '@testing-library/react-native';
|
||||
import { NativeBaseProvider } from "native-base";
|
||||
import Theme from '../Theme';
|
||||
|
||||
import HomeView from './HomeView';
|
||||
// import { en, fr } from '../i18n/Translations';
|
||||
import renderer from 'react-test-renderer'
|
||||
import { Provider } from 'react-redux';
|
||||
import TestRenderer from 'react-test-renderer';
|
||||
import store from '../state/Store';
|
||||
|
||||
import HomeView from '../views/HomeView';
|
||||
|
||||
describe('<HomeView />', () => {
|
||||
|
||||
jest.setTimeout(150000);
|
||||
// const view = () => <NativeBaseProvider theme={Theme}><HomeView/></NativeBaseProvider>;
|
||||
// beforeEach(() => render(view()));
|
||||
|
||||
// it('should render correctly', () => {
|
||||
// expect(screen).toBeDefined();
|
||||
// })
|
||||
//const View = () => <NativeBaseProvider theme={Theme}><HomeView/></NativeBaseProvider>;
|
||||
|
||||
it('Main View should render correctly', async () => {
|
||||
const tree = renderer.create(<NativeBaseProvider theme={Theme}><HomeView/></NativeBaseProvider>).toJSON;
|
||||
expect(tree).toMatchSnapshot();
|
||||
it('has 2 children', () => {
|
||||
const tree = TestRenderer.create(<Provider store={store}><HomeView /></Provider>).toJSON();
|
||||
expect(tree.children.length).toBe(2);
|
||||
});
|
||||
|
||||
|
||||
// it('has should display the text in default language', async () => {
|
||||
// expect((await screen.findAllByText(en.signoutBtn)).length).toBe(1);
|
||||
// });
|
||||
|
||||
// it('has should display the text in the new language', async () => {
|
||||
// fireEvent.press(screen.getByText('Change language'));
|
||||
// expect(store.getState().language.value).toBe('fr');
|
||||
// screen.update(view);
|
||||
// expect((await screen.findAllByText(fr.signoutBtn)).length).toBe(1);
|
||||
// });
|
||||
});
|
||||
|
||||
@@ -1,32 +1,13 @@
|
||||
import React from 'react';
|
||||
// import { Provider } from 'react-redux';
|
||||
// import TestRenderer from 'react-test-renderer';
|
||||
// import store from '../state/Store';
|
||||
import { Provider } from 'react-redux';
|
||||
import TestRenderer from 'react-test-renderer';
|
||||
import store from '../state/Store';
|
||||
|
||||
import { Button, NativeBaseProvider } from "native-base";
|
||||
import Theme from '../Theme';
|
||||
// import { fireEvent, render, screen } from '@testing-library/react-native';
|
||||
import renderer from 'react-test-renderer'
|
||||
import AuthenticationView from '../views/AuthenticationView';
|
||||
|
||||
// import { MainView, PreferencesView } from './SettingsView'
|
||||
|
||||
describe('testing Setting\'s main view', () => {
|
||||
jest.setTimeout(150000);
|
||||
const MainView = () => <NativeBaseProvider theme={Theme}><MainView/></NativeBaseProvider>;
|
||||
const PreferencesView = () => <NativeBaseProvider theme={Theme}><PreferencesView/></NativeBaseProvider>;
|
||||
|
||||
it('Main View should render correctly', async () => {
|
||||
const tree = renderer.create(MainView()).toJSON;
|
||||
expect(tree).toMatchSnapshot();
|
||||
describe('<AuthenticationView />', () => {
|
||||
it('has 3 children', () => {
|
||||
const tree = TestRenderer.create(<Provider store={store}><AuthenticationView /></Provider>).toJSON();
|
||||
expect(tree.children.length).toBe(3);
|
||||
});
|
||||
|
||||
it('Preference View should render correctly', async () => {
|
||||
const tree = renderer.create(PreferencesView()).toJSON;
|
||||
expect(tree).toMatchSnapshot();
|
||||
})
|
||||
|
||||
// it('Preference View should render correctly', async() => {
|
||||
// render(PreferencesView());
|
||||
// expect(screen.findAllByText('en.backBtn')).toBeTruthy();
|
||||
// })
|
||||
});
|
||||
Reference in New Issue
Block a user