Skip to content

Commit 114031b

Browse files
Update coverage handling and clean up scripts
- Added iOS coverage directory to .gitignore for better management - Introduced clean:coverage script in package.json to automate coverage cleanup - Updated vite.config.ts to include iOS public directory in the build process - Removed unused social login mock from SignInForm tests for cleaner test code - Cleaned up SignInForm component by removing SocialLoginButtons import and usage
1 parent 7ef2119 commit 114031b

File tree

7 files changed

+17
-27
lines changed

7 files changed

+17
-27
lines changed

frontend/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# testing
99
/coverage
10+
/coverage/ios
1011
/cypress/screenshots
1112

1213
# production

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"test": "vitest",
1717
"test:ci": "vitest run --coverage --silent",
1818
"test:coverage": "vitest --coverage",
19+
"clean:coverage": "./scripts/clean-coverage.sh",
1920
"test:e2e": "cypress run",
2021
"lint": "eslint .",
2122
"lint:scss": "stylelint \"**/*.scss\"",

frontend/scripts/clean-coverage.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# Clean up coverage directory
4+
echo "Cleaning up coverage directory..."
5+
rm -rf ./coverage
6+
7+
# Make sure iOS coverage directory doesn't exist
8+
if [ -d "./coverage/ios" ]; then
9+
echo "Removing iOS coverage directory..."
10+
rm -rf ./coverage/ios
11+
fi
12+
13+
echo "Coverage directory cleanup complete."

frontend/src/common/components/Auth/__tests__/SignInForm.test.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,7 @@ vi.mock('../../../../common/hooks/useAuth', () => ({
216216
data: null,
217217
isLoading: false,
218218
}),
219-
useSocialSignIn: () => ({
220-
signInWithGoogle: vi.fn(),
221-
signInWithApple: vi.fn(),
222-
isLoading: false,
223-
error: null,
224-
}),
219+
// Removed useSocialSignIn mock
225220
}));
226221

227222
// Mock the AuthErrorDisplay component

frontend/src/pages/Auth/SignIn/components/SignInForm.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import Input from 'common/components/Input/Input';
2626
import Icon from 'common/components/Icon/Icon';
2727
import HeaderRow from 'common/components/Text/HeaderRow';
2828
import CheckboxInput from 'common/components/Input/CheckboxInput';
29-
import SocialLoginButtons from 'common/components/SocialLogin/SocialLoginButtons';
3029
import { formatAuthError } from 'common/utils/auth-errors';
3130
import AuthErrorDisplay from 'common/components/Auth/AuthErrorDisplay';
3231
import AuthLoadingIndicator from 'common/components/Auth/AuthLoadingIndicator';
@@ -211,12 +210,6 @@ const SignInForm = ({ className, testid = 'form-signin' }: SignInFormProps): JSX
211210
{t('signin', { ns: 'auth' })}
212211
</IonButton>
213212

214-
<SocialLoginButtons
215-
className="ls-signin-form__social-buttons"
216-
disabled={isSubmitting || isLoading}
217-
testid={`${testid}-social-buttons`}
218-
/>
219-
220213
<IonRow className="ion-text-center ion-padding-top">
221214
<IonCol>
222215
<IonText color="medium">

frontend/src/pages/Auth/SignIn/components/__tests__/SignInForm.test.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ vi.mock('../../../../../common/hooks/useAuth', () => ({
1111
isLoading: false,
1212
error: null,
1313
}),
14-
useSocialSignIn: () => ({
15-
signInWithGoogle: vi.fn(),
16-
signInWithApple: vi.fn(),
17-
isLoading: false,
18-
error: null,
19-
}),
2014
useSignIn: () => ({
2115
signIn: vi.fn(),
2216
isLoading: false,
@@ -160,14 +154,6 @@ vi.mock('../../../../../common/components/Text/HeaderRow', () => ({
160154
),
161155
}));
162156

163-
vi.mock('../../../../../common/components/SocialLogin/SocialLoginButtons', () => ({
164-
default: ({ className, disabled, testid }: { className?: string; disabled?: boolean; testid?: string }) => (
165-
<div className={className} data-disabled={disabled} data-testid={testid}>
166-
Social Login Buttons
167-
</div>
168-
),
169-
}));
170-
171157
vi.mock('../../../../../common/components/Auth/AuthErrorDisplay', () => ({
172158
default: ({ error, testid }: { error: { message: string } | null; testid?: string }) => (
173159
error ? <div data-testid={testid}>{error.message}</div> : null

frontend/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default defineConfig({
3131
'**/__fixtures__/**',
3232
'**/__mocks__/**',
3333
'android/**',
34+
'ios/App/App/public/**',
3435
'src/main.tsx',
3536
'src/test',
3637
'capacitor.config.ts',

0 commit comments

Comments
 (0)