Skip to content

Instantly share code, notes, and snippets.

View tanner-west's full-sized avatar

Tanner West tanner-west

View GitHub Profile
return (
<>
{showCorrectAnswerCard ? (
<View style={{marginVertical: 5}}>
<Card status={'success'}>
<Text>Correct 🥳</Text>
</Card>
</View>
) : null}
{showWrongAnswerCard ? (
import React from 'react';
import {fireEvent, render} from '@testing-library/react-native';
import * as eva from '@eva-design/eva';
import {ApplicationProvider} from '@ui-kitten/components';
import {IQuestion} from '../types';
import {Question} from '../Question';
describe('<Question />', () => {
const questionProp: IQuestion = {
id: '123-ABC',
return (
<SafeAreaView>
<ScrollView style={{padding: 10}}>
{!quizIsDone ? (
<>
<View>
{questions && questions.length > 0 ? (
<Question
question={questions[currentQuestion]}
onSubmit={onSubmit}
import React from 'react';
import {Provider} from 'react-redux';
import {configureStore} from '@reduxjs/toolkit';
import {fireEvent, render} from '@testing-library/react-native';
import {ApplicationProvider} from '@ui-kitten/components';
import * as eva from '@eva-design/eva';
import questionsReducer from '../../questions/questionsSlice';
import QuizScreen from '../QuizScreen';
jest.mock('react-native-toast-message', () => ({
import '@testing-library/jest-native/extend-expect';
import 'react-native';
import 'jest-enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
import Enzyme from 'enzyme';
/**
* Set up DOM in node.js environment for Enzyme to mount to
*/
const {JSDOM} = require('jsdom');
import React, {useState} from 'react';
import {
SafeAreaView,
Text,
View,
TextInput,
} from 'react-native';
const Name = () => {
const [name, setName] = useState('');
import React from 'react';
import Enzyme, {shallow} from 'enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
import Name from './Name';
Enzyme.configure({adapter: new Adapter()});
describe('<Name />', () => {
let wrapper: any;
import React from 'react';
import {fireEvent, render} from '@testing-library/react-native';
import Name from './Name';
describe('<Name />', () => {
let getByText: any, getByTestId: any;
beforeEach(() => {
({getByText, getByTestId} = render(<Name />));
Amplify.configure({
...awsconfig,
DataStore: {
authModeStrategyType: AuthModeStrategyType.MULTI_AUTH
}
})