so far so good
This commit is contained in:
@@ -8,16 +8,28 @@ 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('should render correctly', () => {
|
||||
let truc = render(view()).toJSON();
|
||||
expect(truc).toBeDefined();
|
||||
})
|
||||
|
||||
it('view should render', () => {
|
||||
expect(screen).toBeDefined();
|
||||
});
|
||||
|
||||
// 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()));
|
||||
|
||||
@@ -12,13 +12,12 @@ describe('<HomeView />', () => {
|
||||
|
||||
jest.setTimeout(150000);
|
||||
const view = () => <NativeBaseProvider theme={Theme}><HomeView/></NativeBaseProvider>;
|
||||
beforeEach(() => render(view()));
|
||||
|
||||
it('should render correctly', () => {
|
||||
let truc = render(view()).toJSON();
|
||||
expect(truc).toBeDefined();
|
||||
expect(screen).toBeDefined();
|
||||
})
|
||||
|
||||
// beforeEach(() => render(view));
|
||||
|
||||
// it('has should display the text in default language', async () => {
|
||||
// expect((await screen.findAllByText(en.signoutBtn)).length).toBe(1);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Provider } from 'react-redux';
|
||||
import TestRenderer from 'react-test-renderer';
|
||||
import store from '../state/Store';
|
||||
|
||||
import { NativeBaseProvider } from "native-base";
|
||||
import { Button, NativeBaseProvider } from "native-base";
|
||||
import Theme from '../Theme';
|
||||
import { fireEvent, render, screen } from '@testing-library/react-native';
|
||||
|
||||
@@ -15,8 +15,14 @@ describe('testing Setting\'s main view', () => {
|
||||
const MainView = () => <NativeBaseProvider theme={Theme}><MainView/></NativeBaseProvider>;
|
||||
const PreferencesView = () => <NativeBaseProvider theme={Theme}><PreferencesView/></NativeBaseProvider>;
|
||||
|
||||
it('should render correctly', () => {
|
||||
let truc = render(MainView()).toJSON();
|
||||
expect(truc).toBeDefined();
|
||||
render(MainView());
|
||||
it('Main View should render correctly', async () => {
|
||||
|
||||
expect(screen.findAllByText('en.prefBtn')).toBeTruthy();
|
||||
})
|
||||
|
||||
// it('Preference View should render correctly', async() => {
|
||||
// render(PreferencesView());
|
||||
// expect(screen.findAllByText('en.backBtn')).toBeTruthy();
|
||||
// })
|
||||
});
|
||||
Reference in New Issue
Block a user