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

[organization] updated organization screen #2085

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 29 additions & 0 deletions src/screens/OrganizationActionItems/OrganizationActionItemMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,35 @@ export const MOCKS = [
lastName: 'Shepherd',
},
},
{
_id: 'actionItem2',
assignee: {
_id: 'user2',
firstName: 'John',
lastName: 'Doe',
},
actionItemCategory: {
_id: 'actionItemCategory2',
name: 'ActionItemCategory 2',
},
preCompletionNotes: 'Pre Completion Notes',
postCompletionNotes: 'Post Completion Notes',
assignmentDate: '2024-02-14',
dueDate: '2024-02-21',
completionDate: '2024-02-21',
isCompleted: false,
assigner: {
_id: 'user0',
firstName: 'Wilt',
lastName: 'Shepherd',
},
event: null,
creator: {
_id: 'user0',
firstName: 'Wilt',
lastName: 'Shepherd',
},
},
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,4 +594,26 @@ describe('Testing Action Item Categories Component', () => {
expect(toast.error).toHaveBeenCalled();
});
});

test('Testing Only Action Items Displaying', async () => {
const mockApp = render(
<MockedProvider addTypename={false} link={link}>
<Provider store={store}>
<BrowserRouter>
<LocalizationProvider dateAdapter={AdapterDayjs}>
<I18nextProvider i18n={i18n}>
{<OrganizationActionItems />}
</I18nextProvider>
</LocalizationProvider>
</BrowserRouter>
</Provider>
</MockedProvider>,
);

await waitFor(mockApp.asFragment);

const actionItem = screen.getByText(/John Doe/i);

expect(actionItem).toContainHTML('John Doe');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ function organizationActionItems(): JSX.Element {
(category) => !category.isDisabled,
);

const actionItemOnly = actionItemsData?.actionItemsByOrganization.filter(
(item) => item.event == null,
);

return (
<div className={styles.organizationActionItemsContainer}>
<div className={`${styles.container} bg-white rounded-4 my-3`}>
Expand Down Expand Up @@ -365,7 +369,7 @@ function organizationActionItems(): JSX.Element {

<ActionItemsContainer
actionItemsConnection={`Organization`}
actionItemsData={actionItemsData?.actionItemsByOrganization}
actionItemsData={actionItemOnly}
membersData={membersData?.organizations[0].members}
actionItemsRefetch={actionItemsRefetch}
/>
Expand Down
Loading