forked from PalisadoesFoundation/talawa-admin
-
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.
Redesign of Donations Page (PalisadoesFoundation#1846)
* Removed `jest-enzyme` package * Adding check for * Added CommunityProfile page * Added tests for CommunityProfile page * Fixed formatting errors * Format fix * Merge branch 'develop' of https://github.com/git-init-priyanshu/talawa-admin-clone into priyanshu * Fixed merge conflicts * Format fix * Fix typecheck error * Added language support * Lint error fix * Integrated APIs * Revert changes * Fixed Failing Test * FIxed failing test * Fixed LoginPage failing tests * Full code coverage * Redesigned the Donations page * Added Tests * Fixed formatting errors
- Loading branch information
1 parent
70642ec
commit b313f80
Showing
13 changed files
with
368 additions
and
69 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
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
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 |
---|---|---|
|
@@ -606,6 +606,7 @@ export const ORGANIZATION_DONATION_CONNECTION_LIST = gql` | |
amount | ||
userId | ||
payPalId | ||
updatedAt | ||
} | ||
} | ||
`; | ||
|
29 changes: 24 additions & 5 deletions
29
src/components/UserPortal/DonationCard/DonationCard.module.css
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
49 changes: 49 additions & 0 deletions
49
src/components/UserPortal/DonationCard/DonationCard.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import { act, render } from '@testing-library/react'; | ||
import { MockedProvider } from '@apollo/react-testing'; | ||
import { I18nextProvider } from 'react-i18next'; | ||
|
||
import { BrowserRouter } from 'react-router-dom'; | ||
import { Provider } from 'react-redux'; | ||
import { store } from 'state/store'; | ||
import i18nForTest from 'utils/i18nForTest'; | ||
import { StaticMockLink } from 'utils/StaticMockLink'; | ||
import DonationCard from './DonationCard'; | ||
import { type InterfaceDonationCardProps } from 'screens/UserPortal/Donate/Donate'; | ||
|
||
const link = new StaticMockLink([], true); | ||
|
||
async function wait(ms = 100): Promise<void> { | ||
await act(() => { | ||
return new Promise((resolve) => { | ||
setTimeout(resolve, ms); | ||
}); | ||
}); | ||
} | ||
|
||
const props: InterfaceDonationCardProps = { | ||
id: '1', | ||
name: 'John Doe', | ||
amount: '20', | ||
userId: '1234', | ||
payPalId: 'id', | ||
updatedAt: String(new Date()), | ||
}; | ||
|
||
describe('Testing ContactCard Component [User Portal]', () => { | ||
test('Component should be rendered properly', async () => { | ||
render( | ||
<MockedProvider addTypename={false} link={link}> | ||
<BrowserRouter> | ||
<Provider store={store}> | ||
<I18nextProvider i18n={i18nForTest}> | ||
<DonationCard {...props} /> | ||
</I18nextProvider> | ||
</Provider> | ||
</BrowserRouter> | ||
</MockedProvider>, | ||
); | ||
|
||
await wait(); | ||
}); | ||
}); |
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
Oops, something went wrong.