Skip to content

Commit

Permalink
Merge branch 'PalisadoesFoundation:develop' into SecuredRouteForUser-…
Browse files Browse the repository at this point in the history
…Test
  • Loading branch information
duplixx authored Nov 11, 2023
2 parents c46c375 + 57baf75 commit 5bba391
Show file tree
Hide file tree
Showing 17 changed files with 564 additions and 357 deletions.
4 changes: 2 additions & 2 deletions src/GraphQl/Queries/Queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ export const ORGANIZATION_POST_LIST = gql`
lastName
email
}
createdAt
}
}
`;
Expand Down Expand Up @@ -594,7 +595,7 @@ export const ORGANIZATION_POST_CONNECTION_LIST = gql`
lastName
email
}
pinned
createdAt
likeCount
commentCount
comments {
Expand All @@ -611,7 +612,6 @@ export const ORGANIZATION_POST_CONNECTION_LIST = gql`
}
text
}
createdAt
likedBy {
_id
firstName
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -5560,7 +5560,7 @@ fieldset:disabled .btn {
box-shadow: var(--bs-toast-box-shadow);
border-radius: var(--bs-toast-border-radius);
}
.toast.showing {
.showing {
opacity: 0;
}
.toast:not(.show) {
Expand Down
1 change: 1 addition & 0 deletions src/assets/svgs/date.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/svgs/location.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/svgs/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/components/EventListCard/EventListCard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
justify-content: flex-end;
}
.icon {
transform: scale(1);
cursor: pointer;
color: #31bb6b;
margin: 1px;
}

.cards {
Expand Down Expand Up @@ -86,6 +84,8 @@
}
.dispflex {
display: flex;
margin-bottom: 5px;
margin-right: 5px;
}
.dispflex > input {
width: 20%;
Expand Down
41 changes: 37 additions & 4 deletions src/components/EventListCard/EventListCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,30 @@ describe('Testing Event List Card', () => {
expect(screen.queryByText(props.eventName)).not.toBeInTheDocument();
});

test('Testing for update modal', async () => {
render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<Provider store={store}>
<I18nextProvider i18n={i18nForTest}>
<EventListCard {...props} />
</I18nextProvider>
</Provider>
</BrowserRouter>
</MockedProvider>
);

await wait();

userEvent.click(screen.getByTestId('card'));
userEvent.click(screen.getByTestId('editEventModalBtn'));

userEvent.click(screen.getByTestId('EventUpdateModalCloseBtn'));
userEvent.click(screen.getByTestId('createEventModalCloseBtn'));

await wait();
});

test('Testing event update functionality', async () => {
render(
<MockedProvider addTypename={false} link={link}>
Expand All @@ -159,7 +183,8 @@ describe('Testing Event List Card', () => {
);

await wait();

userEvent.click(screen.getByTestId('card'));
userEvent.click(screen.getByTestId('editEventModalBtn'));
userEvent.type(screen.getByTestId('updateTitle'), props.eventName);
userEvent.type(
screen.getByTestId('updateDescription'),
Expand Down Expand Up @@ -199,7 +224,8 @@ describe('Testing Event List Card', () => {
);

await wait();

userEvent.click(screen.getByTestId('card'));
userEvent.click(screen.getByTestId('editEventModalBtn'));
userEvent.type(screen.getByTestId('updateTitle'), props.eventName);
userEvent.type(
screen.getByTestId('updateDescription'),
Expand Down Expand Up @@ -232,6 +258,11 @@ describe('Testing Event List Card', () => {
<EventListCard {...props} />
</MockedProvider>
);
userEvent.click(screen.getByTestId('card'));
userEvent.click(screen.getByTestId('deleteEventModalBtn'));

userEvent.click(screen.getByTestId('EventDeleteModalCloseBtn'));
userEvent.click(screen.getByTestId('createEventModalCloseBtn'));
});

it('should call the delete event mutation when the "Yes" button is clicked', async () => {
Expand All @@ -240,7 +271,8 @@ describe('Testing Event List Card', () => {
<EventListCard {...props} />
</MockedProvider>
);

userEvent.click(screen.getByTestId('card'));
userEvent.click(screen.getByTestId('deleteEventModalBtn'));
const deleteBtn = screen.getByTestId('deleteEventBtn');
fireEvent.click(deleteBtn);
});
Expand All @@ -263,7 +295,8 @@ describe('Testing Event List Card', () => {
<EventListCard {...props} />
</MockedProvider>
);

userEvent.click(screen.getByTestId('card'));
userEvent.click(screen.getByTestId('deleteEventModalBtn'));
const deleteBtn = screen.getByTestId('deleteEventBtn');
fireEvent.click(deleteBtn);
});
Expand Down
Loading

0 comments on commit 5bba391

Please sign in to comment.