Skip to content

Commit

Permalink
Merge pull request #27 from atlp-rwanda/ft-cart-management-#187300210
Browse files Browse the repository at this point in the history
 #187300210 cart management
  • Loading branch information
Eli250 authored Jun 25, 2024
2 parents 569278c + e78f0ad commit 3b19d13
Show file tree
Hide file tree
Showing 34 changed files with 1,319 additions and 124 deletions.
115 changes: 96 additions & 19 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
}
}
}
Binary file added public/cartAllow.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 public/delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/logo.svg
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 public/lowerArrow.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 public/shoes.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 public/upperArrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 14 additions & 17 deletions src/__tests__/2FA_Authentication.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,24 @@ import twoFactorAuthSlice from '../redux/slices/2faAuthenticationSlice';
import axios from 'axios';
jest.mock('axios');
const URL = process.env.URL;
console.log("iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii",URL)
const store: any = configureStore({
reducer: {
sellerOTP: twoFactorAuthSlice,
},
});

jest.mock('../utils/axios', () => {
return {
create: jest.fn(() => ({
interceptors: {
request: { use: jest.fn() },
response: { use: jest.fn() },
},
})),
};
});

type RootState = ReturnType<typeof store.getState>;
type AppDispatch = typeof store.dispatch;
jest.mock('next/navigation', () => ({
Expand All @@ -45,23 +58,6 @@ describe('Login Tests', () => {
</Provider>,
);
});
// it('should handle OTP verification fulfilled action', async () => {
// const {getByTestId}=render(<Provider store={store}><OtpVerify isOpen={true} /></Provider>);
// const otpToken = 'token-login';
// const result= mockedAxios.onPost(`${URL}/users/otp/${otpToken}`).reply(201, {token:otpToken })
// await act(async () => {
// await store.dispatch(handleOTPVerification('12345'));
// await store.dispatch({
// type: handleOTPVerification.fulfilled.type,
// payload: otpToken,
// })
// });
// const state:RootState= store.getState();
// console.log('state', state);
// expect(state.sellerOTP.loading).toBe(false);
// expect(state.sellerOTP.newOtp).toBe(false);
// expect(localStorage.getItem('token')).toBe(otpToken);
// });
it('should handle OTP verification pending action', async () => {
const { getByTestId } = render(
<Provider store={store}>
Expand Down Expand Up @@ -147,6 +143,7 @@ describe('Login Tests', () => {
expect(state.sellerOTP.loading).toBe(false);
expect(state.sellerOTP.newOtp).toBe(false);
});

});


Expand Down
3 changes: 3 additions & 0 deletions src/__tests__/BuyerProduct.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { render, screen, waitFor } from '@testing-library/react';
import ProductPage from '@/app/products/[id]/page';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import ProductList from '@/components/ProductList';
import Providers from '@/app/providers';
// Test suite for the Home page
const queryClient = new QueryClient();

Expand Down Expand Up @@ -65,7 +66,9 @@ describe('Home page', () => {
it('renders without crashing', () => {
const { getByText } = render(
<QueryClientProvider client={queryClient}>
<Providers>
<ProductList />
</Providers>
</QueryClientProvider>
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Signup.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ describe('Signup Components', () => {
expect(screen.queryByText('Email is required')).toBeInTheDocument();
expect(screen.queryByText('Password is required')).toBeInTheDocument();
});
});
});
Loading

0 comments on commit 3b19d13

Please sign in to comment.