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

Fix/goals margin #138

Closed
wants to merge 2 commits into from
Closed
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
33 changes: 21 additions & 12 deletions __tests__/Component-test.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
import React from "react";
import {fireEvent, render} from "@testing-library/react-native"
import ShortGoalsComponent from "../src/components/ShortGoalsComponent/ShortGoalsComponent";
import React from 'react';
import { fireEvent, render } from '@testing-library/react-native';
import ShortGoalsComponent from '../src/components/ShortGoalsComponent/ShortGoalsComponent';

// Short Term Goals component test

test('flatlist does not exist on initial render', () => {
const {queryByTestId, getByTestId } = render(<ShortGoalsComponent/>);
expect(queryByTestId('flatlist')).toBeNull();
expect(getByTestId('arrowBtnIcon').props.style).toStrictEqual({resizeMode: 'cover', width: 30, height: 30,})
})
const { queryByTestId, getByTestId } = render(<ShortGoalsComponent />);
expect(queryByTestId('flatlist')).toBeNull();
expect(getByTestId('arrowBtnIcon').props.style).toStrictEqual({
resizeMode: 'cover',
width: 30,
height: 30,
});
});

test('flatlist exists when we click on the arrow button', () => {
const {queryByTestId, getByTestId} = render(<ShortGoalsComponent/>)
fireEvent.press(getByTestId('arrowBtn'))
expect(queryByTestId('flatlist')).toBeTruthy();
expect(getByTestId('arrowBtnIcon').props.style).toStrictEqual({resizeMode: 'cover', width: 30, height: 30, transform: [{ rotate: '90deg' }],})
})
const { queryByTestId, getByTestId } = render(<ShortGoalsComponent />);
fireEvent.press(getByTestId('arrowBtn'));
expect(queryByTestId('flatlist')).toBeTruthy();
expect(getByTestId('arrowBtnIcon').props.style).toStrictEqual({
resizeMode: 'cover',
width: 30,
height: 30,
transform: [{ rotate: '90deg' }],
});
});
4 changes: 1 addition & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
"react-native-reanimated/plugin",
],
plugins: ['react-native-reanimated/plugin'],
};
Loading