-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
198 chore files allocation across repo and assign writing tests tasks…
… to team (#199) * 🚰ci: collect coverage from api, and rename testing command * 🗑️chore: shadcn removal, reduce bundle size * 🗑️chore: where else do we delete useless stuff * 🗑️chore: nah, fk nextjs * 🐛fix: resolve conflict of tsconfig and added fonts, a shit tons of it * ✨feat: default header with gap, ass * 🐛fix: expo jest now instead of test * 🐛fix: fk snapshot got hands * 🐧chore: try to manage packages, but realized we are too late for that * 🐧chore: wasting * ♻️chore: versions control * ♻️chore: versions control II * ♻️ feat: TUI turbo ITS FK GREAT * 🐞bugs: fixed tailwind works on sum,d oesn't on others https://www.nativewind.dev/quick-starts/react-native-cli setup tailwind section * 🐞fixed: single quote fixed, no body against it * 🐧bug: attempt to use marcos bottom sheet,agasin, FAILED * ♻️code: trash * Revert "♻️code: trash" This reverts commit 80d1940. * 🐧fk: imma need input * 🐧 ui: lets help others * 🗑️chore: fixed pnpm audit and versions control, prisma latest * 📁chore: sleep first, code after, * 🐞bugS: fixed all your silly mistakes * 🐞fixed: ts * 🐧ui: atta boi, google gap-2 * 🐞fixed: help stef before * 🐧masdasmdlkasd * 🐧chore: chore * ♻️ bugs: deployment realted * 📁bug: wher am i * ♻️fixed: testin and trpc typed * 🐧ui: default header * 🐞bugs: version version of pnpm up caniuse-lite * 🐧 fluc: better message * 🐞fluc: aight, real works this time * 🐧ui: default header, background new color * 🐧fluc: why tf I keep doing sidequest * 🐞fixing: sdk 50 maybe, nativewind is ASS * 🐧fluc: BEEFIEST update sdk jesus why you do this to me * ♻️tldr: nativewind/nativewind#628 * Auto stash before merge of "165-frontend-move-header-to-the-correct-location" and "origin/165-frontend-move-header-to-the-correct-location" * Auto stash before merge of "165-frontend-move-header-to-the-correct-location" and "origin/165-frontend-move-header-to-the-correct-location" * ⚙️tldr: java 17 instead of 11 now, FK YOU EXPO * ⚙️tldr: fixing https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/installation * 🐞bug: gorhom/react-native-bottom-sheet#1332 another broken lib * 🐞bug: can't fix the bottom sheet, is beyond us * 🐧feat: layout, 1 * 🐧fluc: layout 1 done,2 more to go and get rid of the unsued import * 🐧ui: picker...watf * 🐧ui: im so sorry guys, workout screen * 🐧ui: inbox screen structure * 🐧ui: inbox structure done, now to friends * 🐧ui: friends done,ui ready * 🐧ci/cd: tesgting added * 🐞fix: will write test in the next issue * 🐧good to go * 📁fixed: the damn LOGIN of CLERTK * ♻️build: prisma schema migration init * ♻️build: standardize ti * 🐧build: comment out the eas * 📁chore: fixed * 📁chore: fixed seed prod * 🗑️chore: files name and relative path 1. change all routers to..duh routers 2. update all relative path, even if it is test files 3. move all test file to a dedicated folder, avoid clutter 4. about to write picker-modal test * 🗑️chore: okay, got it, WHO TF WROTE TOGGLE * 🗑️chore: files name, dadadada * 🗑️chore:f iles name change again * 🤦♂️ci/cd; divider test pass, failed action-button rename tests in api to router, specifically * 🐧ci/cd: passed action-button, now onto picker-modal * 🐧fluc: testing passed, more snapshot, fk me * 🤦♂️ fluc: revertable, af FK CLERK * 🤦♂️attempt: to fixed the stupid warning * Revert "🤦♂️attempt: to fixed the stupid warning" This reverts commit 5a6ad2f. * 🤦♂️fixed: signed out fixed, now doing sign in, Jesus * 🤦♂️idk: fk it * 🐧updateD: snapshot * ♻️chore: snapshot II * 🐧fixed: jesus, writeing unit test and fix aaron toggle * 🐧fluc: extend timeout * 🤦♂️fluc: extend timeout * 👑fluic: fk * 🤦♂️remove: un need file * ♻️fixed: ts error from main * ♻️coverage: brrrr brrrrr
- Loading branch information
Showing
89 changed files
with
1,370 additions
and
390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React from 'react' | ||
import { router } from 'expo-router' | ||
|
||
import { fireEvent, render } from '@testing-library/react-native' | ||
|
||
import { DashboardHeader } from '../layouts/headers/dashboard-header' | ||
import { FriendsHeader } from '../layouts/headers/friends-header' | ||
import { InboxHeader } from '../layouts/headers/inbox-headers' | ||
import { WorkoutHeader } from '../layouts/headers/workout-headers' | ||
|
||
jest.mock('~assets/svgs/notification.svg', () => 'NotificationSVG') | ||
jest.mock('~assets/svgs/arrow-left.svg', () => 'ArrowLeftSVG') | ||
jest.mock('~assets/svgs/friends.svg', () => 'FriendsSVG') | ||
jest.mock('~assets/svgs/write.svg', () => 'WriteSVG') | ||
jest.mock('expo-router', () => ({ | ||
router: { | ||
back: jest.fn(), | ||
}, | ||
})) | ||
|
||
describe('DashboardHeader', () => { | ||
it('renders correctly', () => { | ||
const { getByText } = render(<DashboardHeader />) | ||
expect(getByText('BARBELL')).toBeTruthy() | ||
}) | ||
}) | ||
|
||
describe('FriendsHeader', () => { | ||
it('renders correctly', () => { | ||
const { getByText } = render(<FriendsHeader />) | ||
expect(getByText('Friends List')).toBeTruthy() | ||
}) | ||
|
||
it('navigates back on press', () => { | ||
const { getByTestId } = render(<FriendsHeader />) | ||
const button = getByTestId('friends-header-button') | ||
fireEvent.press(button) | ||
expect(router.back).toHaveBeenCalled() | ||
}) | ||
}) | ||
|
||
describe('InboxHeader', () => { | ||
it('renders with dynamic title', () => { | ||
const title = 'Inbox' | ||
const { getByTestId } = render(<InboxHeader title={title} />) | ||
const button = getByTestId('inbox-header-button') | ||
expect(button).toBeTruthy() | ||
fireEvent.press(button) | ||
expect(router.back).toHaveBeenCalled() | ||
}) | ||
}) | ||
|
||
describe('WorkoutHeader', () => { | ||
it('renders correctly', () => { | ||
const { getByText } = render(<WorkoutHeader />) | ||
expect(getByText('BARBELL')).toBeTruthy() | ||
const { getByTestId } = render(<WorkoutHeader />) | ||
const button = getByTestId('workout-header-button') | ||
fireEvent.press(button) | ||
expect(router.back).toHaveBeenCalled() | ||
}) | ||
}) |
2 changes: 1 addition & 1 deletion
2
.../components/message/messageInput.test.tsx → .../expo/src/__tests__/messageInput.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import React, { Component } from 'react' | ||
import { Dimensions } from 'react-native' | ||
|
||
import { fireEvent, render, waitFor } from '@testing-library/react-native' | ||
import { act } from 'react-test-renderer' | ||
|
||
import Toggle from '~/components/toggle/toggle' | ||
|
||
/** | ||
* @see https://github.com/orgs/react-hook-form/discussions/4232 | ||
*/ | ||
|
||
describe('Toggle component', () => { | ||
beforeAll(() => { | ||
jest.setTimeout(30000) | ||
}) | ||
|
||
/* git force */ | ||
const originalConsoleError = console.error | ||
beforeAll(() => { | ||
console.error = (message, ...args) => { | ||
if (/not wrapped in act\(...\)/.test(message)) { | ||
return | ||
} | ||
originalConsoleError(message, ...args) | ||
} | ||
}) | ||
|
||
afterAll(() => { | ||
console.error = originalConsoleError | ||
}) | ||
|
||
const { width: screenWidth } = Dimensions.get('window') | ||
|
||
it('should render correctly', async () => { | ||
const { getByTestId } = render(<Toggle value={false} onValueChange={() => {}} label='Test' />) | ||
|
||
await waitFor(() => expect(getByTestId('toggle-container')).toBeDefined()) | ||
await waitFor(() => expect(getByTestId('toggle-switch')).toBeDefined()) | ||
await waitFor(() => expect(getByTestId('toggle-label')).toBeDefined()) | ||
}) | ||
|
||
it('should call onValueChange function when toggled', async () => { | ||
const onValueChange = jest.fn() | ||
const { getByTestId } = render( | ||
<Toggle value={false} onValueChange={onValueChange} label='Test' />, | ||
) | ||
const toggleSwitch = getByTestId('toggle-switch') | ||
|
||
await act(async () => { | ||
fireEvent.press(toggleSwitch) | ||
}) | ||
|
||
await waitFor(() => expect(onValueChange).toHaveBeenCalledTimes(1)) | ||
}) | ||
|
||
it('should animate the switch when the value prop changes', async () => { | ||
const { getByTestId, rerender } = render( | ||
<Toggle value={false} onValueChange={() => {}} label='Test' />, | ||
) | ||
const toggleCircle = getByTestId('toggle-circle') | ||
|
||
expect(toggleCircle.props.style.marginLeft).toBeCloseTo(screenWidth * 0.01, 1) | ||
|
||
await act(async () => { | ||
rerender(<Toggle value={true} onValueChange={() => {}} label='Test' />) | ||
}) | ||
// await waitFor(() => expect(myInput).toHaveValue('value')) | ||
await waitFor(() => expect(toggleCircle.props.style.marginLeft).toBeCloseTo(79.5)) | ||
}) | ||
|
||
it('should update the background color of the switch when the value prop changes', async () => { | ||
const { getByTestId, rerender } = render( | ||
<Toggle value={false} onValueChange={() => {}} label='Test' />, | ||
) | ||
const toggleSwitch = getByTestId('toggle-switch') | ||
|
||
// expect(toggleSwitch.props.style.backgroundColor).toContain('rgba(58, 58, 58, 1)') | ||
await waitFor(() => | ||
expect(toggleSwitch.props.style.backgroundColor).toContain('rgba(58, 58, 58, 1)'), | ||
) | ||
|
||
await act(async () => { | ||
rerender(<Toggle value={true} onValueChange={() => {}} label='Test' />) | ||
}) | ||
|
||
// await waitFor(() => expect(myInput).toHaveValue('value')); | ||
await waitFor(() => | ||
expect(toggleSwitch.props.style.backgroundColor).toContain('rgba(58, 58, 58, 1)'), | ||
) | ||
}) | ||
|
||
it('should match snapshop', () => { | ||
const { toJSON } = render(<Toggle value={false} onValueChange={() => {}} label='Test' />) | ||
expect(toJSON()).toMatchSnapshot() | ||
}) | ||
}) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../src/components/ui/button/button.test.tsx → apps/expo/src/__tests__/ui/button.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.