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

fixed:2527 Refactored CSS files in src/screens/UserPortal #3012

Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
6 changes: 3 additions & 3 deletions src/components/UpdateSession/UpdateSession.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@
// Simulate dragging to minimum value
userEvent.click(slider, {
// Simulate clicking on the slider to focus
clientX: -999, // Adjust the clientX to simulate different slider positions
// clientX: -999, // Adjust the clientX to simulate different slider positions
});

expect(mockOnValueChange).toHaveBeenCalledWith(15); // Adjust based on slider min value

Check failure on line 110 in src/components/UpdateSession/UpdateSession.spec.tsx

View workflow job for this annotation

GitHub Actions / Test Application

src/components/UpdateSession/UpdateSession.spec.tsx > Testing UpdateTimeout Component > Should handle minimum slider value correctly

AssertionError: expected "spy" to be called with arguments: [ 15 ] Received: Number of calls: 0 ❯ src/components/UpdateSession/UpdateSession.spec.tsx:110:31
});

it('Should handle maximum slider value correctly', async () => {
Expand All @@ -124,10 +124,10 @@
// Simulate dragging to maximum value
userEvent.click(slider, {
// Simulate clicking on the slider to focus
clientX: 999, // Adjust the clientX to simulate different slider positions
// clientX: 999, // Adjust the clientX to simulate different slider positions
});

expect(mockOnValueChange).toHaveBeenCalledWith(60); // Adjust based on slider max value

Check failure on line 130 in src/components/UpdateSession/UpdateSession.spec.tsx

View workflow job for this annotation

GitHub Actions / Test Application

src/components/UpdateSession/UpdateSession.spec.tsx > Testing UpdateTimeout Component > Should handle maximum slider value correctly

AssertionError: expected "spy" to be called with arguments: [ 60 ] Received: Number of calls: 0 ❯ src/components/UpdateSession/UpdateSession.spec.tsx:130:31
});

it('Should not update value if an invalid value is passed', async () => {
Expand All @@ -144,7 +144,7 @@
// Simulate invalid value handling
userEvent.click(slider, {
// Simulate clicking on the slider to focus
clientX: 0, // Adjust the clientX to simulate different slider positions
// clientX: 0, // Adjust the clientX to simulate different slider positions
});

// Ensure onValueChange is not called with invalid values
Expand Down
137 changes: 0 additions & 137 deletions src/screens/UserPortal/Campaigns/Campaigns.module.css

This file was deleted.

2 changes: 1 addition & 1 deletion src/screens/UserPortal/Campaigns/Campaigns.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { Dropdown, Form, Button, ProgressBar } from 'react-bootstrap';
import styles from './Campaigns.module.css';
import styles from '../../../style/app.module.css';
import { useTranslation } from 'react-i18next';
import { Navigate, useNavigate, useParams } from 'react-router-dom';
import { Circle, Search, Sort, WarningAmberRounded } from '@mui/icons-material';
Expand Down
35 changes: 13 additions & 22 deletions src/screens/UserPortal/Campaigns/PledgeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
InterfacePledgeInfo,
InterfaceUserInfo,
} from 'utils/interfaces';
import styles from './Campaigns.module.css';
import styles from '../../../style/app.module.css';
import React, { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useMutation, useQuery } from '@apollo/client';
Expand Down Expand Up @@ -133,7 +133,6 @@ const PledgeModal: React.FC<InterfacePledgeModal> = ({
* @param e - The form submission event.
* @returns A promise that resolves when the pledge is successfully updated.
*/
/*istanbul ignore next*/
const updatePledgeHandler = useCallback(
async (e: ChangeEvent<HTMLFormElement>): Promise<void> => {
e.preventDefault();
Expand Down Expand Up @@ -209,7 +208,6 @@ const PledgeModal: React.FC<InterfacePledgeModal> = ({
});
hide();
} catch (error: unknown) {
/*istanbul ignore next*/
toast.error((error as Error).message);
}
},
Expand Down Expand Up @@ -255,15 +253,12 @@ const PledgeModal: React.FC<InterfacePledgeModal> = ({
getOptionLabel={(member: InterfaceUserInfo): string =>
`${member.firstName} ${member.lastName}`
}
onChange={
/*istanbul ignore next*/
(_, newPledgers): void => {
setFormState({
...formState,
pledgeUsers: newPledgers,
});
}
}
onChange={(_, newPledgers): void => {
setFormState({
...formState,
pledgeUsers: newPledgers,
});
}}
renderInput={(params) => (
<TextField {...params} label="Pledgers" />
)}
Expand All @@ -283,7 +278,6 @@ const PledgeModal: React.FC<InterfacePledgeModal> = ({
pledgeStartDate: date.toDate(),
pledgeEndDate:
pledgeEndDate &&
/*istanbul ignore next*/
(pledgeEndDate < date?.toDate()
? date.toDate()
: pledgeEndDate),
Expand Down Expand Up @@ -322,15 +316,12 @@ const PledgeModal: React.FC<InterfacePledgeModal> = ({
value={pledgeCurrency}
label={t('currency')}
data-testid="currencySelect"
onChange={
/*istanbul ignore next*/
(e) => {
setFormState({
...formState,
pledgeCurrency: e.target.value,
});
}
}
onChange={(e) => {
setFormState({
...formState,
pledgeCurrency: e.target.value,
});
}}
>
{currencyOptions.map((currency) => (
<MenuItem key={currency.label} value={currency.value}>
Expand Down
Loading
Loading