Skip to content

Commit

Permalink
Merge pull request #4 from TaskRatchet/Working
Browse files Browse the repository at this point in the history
Home Screen, List, Styling, Organization, Tests, and API updates.
  • Loading branch information
lcflight authored Dec 27, 2023
2 parents 7eee0b2 + c935236 commit fbb3108
Show file tree
Hide file tree
Showing 66 changed files with 13,513 additions and 3,580 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install
run: npm install
- name: Test
run: npm test
run: npm test -- --ci --coverage --watchAll=false
Prettier:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 5 additions & 0 deletions __mocks__/@react-native-async-storage/async-storage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
jest.mock('@react-native-async-storage/async-storage', () => ({
getItem: jest.fn(() => Promise.resolve('token')),
setItem: jest.fn(() => Promise.resolve()),
removeItem: jest.fn(),
}));
27 changes: 27 additions & 0 deletions __tests__/getStoredUser.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'react-native';
import getStoredUser from '../src/utils/getStoredUser';

// Note: import explicitly to use the types shiped with jest.
import {it, expect} from '@jest/globals';
import {get} from 'http';

// Mock AsyncStorage
jest.mock('@react-native-async-storage/async-storage', () => ({
getItem: jest.fn(() => Promise.resolve(JSON.stringify('me'))),
}));

// Import the mocked AsyncStorage
const AsyncStorage = jest.requireMock(
'@react-native-async-storage/async-storage',
);

describe('getStoredUser', () => {
it('Calls AsyncStorage.getItem', async () => {
await getStoredUser();

expect(AsyncStorage.getItem).toBeCalledWith('me');
});
it('Gets User From AsyncStorage', async () => {
await expect(getStoredUser()).resolves.toBe('me');
});
});
8 changes: 8 additions & 0 deletions __tests__/loginScreen.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
describe('loginScreen', () => {
it('test runs', async () => {
expect(true).toBeTruthy();
// Arrange
// Act
// Assert
});
});
14 changes: 14 additions & 0 deletions __tests__/taskPopup.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {render} from '@testing-library/react-native';
import React from 'react';
import App from '../src/App';

describe('TaskPopup', () => {
it('does not render at login', () => {
const {queryByTestId} = render(<App />);

// Assuming TaskPopup has a testID prop set to 'taskPopup'
const taskPopup = queryByTestId('taskPopup');

expect(taskPopup).toBeNull();
});
});
Binary file added assets/fonts/Roboto-Bold.ttf
Binary file not shown.
Binary file added assets/icons/filter_add(black).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/filter_add(black).psd
Binary file not shown.
Binary file added assets/icons/filter_add(white).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/filter_delete(black).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/filter_delete(white).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/information_icon(black).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/information_icon(white).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/menu(black).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/menu(white).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/plus(black).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/plus(white).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/user_logo(black).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/user_logo(white).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 24 additions & 6 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ PODS:
- React-jsinspector (0.72.7)
- React-logger (0.72.7):
- glog
- react-native-safe-area-context (4.7.4):
- react-native-encrypted-storage (4.0.3):
- React-Core
- react-native-safe-area-context (4.8.1):
- React-Core
- react-native-secure-key-store (2.0.10):
- React-Core
- React-NativeModulesApple (0.72.7):
- hermes-engine
Expand Down Expand Up @@ -487,13 +491,15 @@ PODS:
- React-jsi (= 0.72.7)
- React-logger (= 0.72.7)
- React-perflogger (= 0.72.7)
- RNCAsyncStorage (1.21.0):
- React-Core
- RNGestureHandler (2.14.0):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- RNScreens (3.27.0):
- RNScreens (3.29.0):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- RNVectorIcons (10.0.2):
- RNVectorIcons (10.0.3):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- SocketRocket (0.6.1)
Expand Down Expand Up @@ -547,7 +553,9 @@ DEPENDENCIES:
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-encrypted-storage (from `../node_modules/react-native-encrypted-storage`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-secure-key-store (from `../node_modules/react-native-secure-key-store`)
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
Expand All @@ -565,6 +573,7 @@ DEPENDENCIES:
- React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
- React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNScreens (from `../node_modules/react-native-screens`)
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
Expand Down Expand Up @@ -631,8 +640,12 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-encrypted-storage:
:path: "../node_modules/react-native-encrypted-storage"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
react-native-secure-key-store:
:path: "../node_modules/react-native-secure-key-store"
React-NativeModulesApple:
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
React-perflogger:
Expand Down Expand Up @@ -667,6 +680,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/react/utils"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
RNCAsyncStorage:
:path: "../node_modules/@react-native-async-storage/async-storage"
RNGestureHandler:
:path: "../node_modules/react-native-gesture-handler"
RNScreens:
Expand Down Expand Up @@ -710,7 +725,9 @@ SPEC CHECKSUMS:
React-jsiexecutor: c49502e5d02112247ee4526bc3ccfc891ae3eb9b
React-jsinspector: 8baadae51f01d867c3921213a25ab78ab4fbcd91
React-logger: 8edc785c47c8686c7962199a307015e2ce9a0e4f
react-native-safe-area-context: 2cd91d532de12acdb0a9cbc8d43ac72a8e4c897c
react-native-encrypted-storage: db300a3f2f0aba1e818417c1c0a6be549038deb7
react-native-safe-area-context: cd1169d797a2ef722a00bfc5af10748d5b6c94f9
react-native-secure-key-store: 910e6df6bc33cb790aba6ee24bc7818df1fe5898
React-NativeModulesApple: b6868ee904013a7923128892ee4a032498a1024a
React-perflogger: 31ea61077185eb1428baf60c0db6e2886f141a5a
React-RCTActionSheet: 392090a3abc8992eb269ef0eaa561750588fc39d
Expand All @@ -728,9 +745,10 @@ SPEC CHECKSUMS:
React-runtimescheduler: 7649c3b46c8dee1853691ecf60146a16ae59253c
React-utils: 56838edeaaf651220d1e53cd0b8934fb8ce68415
ReactCommon: 5f704096ccf7733b390f59043b6fa9cc180ee4f6
RNCAsyncStorage: 618d03a5f52fbccb3d7010076bc54712844c18ef
RNGestureHandler: 32a01c29ecc9bb0b5bf7bc0a33547f61b4dc2741
RNScreens: 3c2d122f5e08c192e254c510b212306da97d2581
RNVectorIcons: 23b6e11af4aaf104d169b1b0afa7e5cf96c676ce
RNScreens: 3c5b9f4a9dcde752466854b6109b79c0e205dad3
RNVectorIcons: 64e6a523ac30a3241efa9baf1ffbcc5e76ff747a
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
preset: 'react-native',
moduleNameMapper: {
// Match all files ending in `.png` or other image formats if needed
'\\.(png)$': '<rootDir>/__mocks__/fileMock.js',
'\\.(jpg|jpeg|png|gif)$': '<rootDir>/__mocks__/fileMock.js',
},
setupFilesAfterEnv: ['./jest.setup.js'],
};
10 changes: 10 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ jest.mock('@react-navigation/stack', () => ({
Navigator: jest.fn(),
})),
}));

jest.mock('react-native-secure-key-store', () => ({
set: jest.fn(),
get: jest.fn(),
remove: jest.fn(),
ACCESSIBLE: {
WHEN_UNLOCKED: 'WHEN_UNLOCKED',
// Add other properties if needed
},
}));
Loading

0 comments on commit fbb3108

Please sign in to comment.