Skip to content

Commit

Permalink
Added: Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SiddheshKukade committed Sep 24, 2023
1 parent 8d8bb56 commit 7c8a2dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ describe('Testing OrganizationNavbar Component [User Portal]', () => {

expect(getOrganizationIdSpy).toHaveBeenCalled();
expect(screen.queryByText('anyOrganization1')).toBeInTheDocument();
// Check if navigation links are rendered
expect(screen.getByText('Home')).toBeInTheDocument();
expect(screen.getByText('People')).toBeInTheDocument();
expect(screen.getByText('Events')).toBeInTheDocument();
expect(screen.getByText('Donate')).toBeInTheDocument();
expect(screen.getByText('Chat')).toBeInTheDocument();
});

test('The language is switched to English', async () => {
Expand All @@ -124,6 +130,12 @@ describe('Testing OrganizationNavbar Component [User Portal]', () => {
await wait();

expect(cookies.get('i18next')).toBe('en');
// Check if navigation links are rendered
expect(screen.getByText('Home')).toBeInTheDocument();
expect(screen.getByText('People')).toBeInTheDocument();
expect(screen.getByText('Events')).toBeInTheDocument();
expect(screen.getByText('Donate')).toBeInTheDocument();
expect(screen.getByText('Chat')).toBeInTheDocument();
});

test('The language is switched to fr', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ function organizationNavbar(props: InterfaceNavbarProps): JSX.Element {
}

if (updatedPluginData != undefined) {
console.log('Update received');
console.log(updatedPluginData.onPluginUpdate.pluginName);

const pluginName = updatedPluginData.onPluginUpdate.pluginName;
const uninstalledOrgs = updatedPluginData.onPluginUpdate.uninstalledOrgs;
const pluginIndexToRemove = getPluginIndex(pluginName, plugins);

Check warning on line 116 in src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.tsx#L114-L116

Added lines #L114 - L116 were not covered by tests
Expand Down

0 comments on commit 7c8a2dd

Please sign in to comment.