Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'PalisadoesFoundation:develop' into SecuredRouteForUser-…
Browse files Browse the repository at this point in the history
…Test
duplixx authored Nov 11, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents c46c375 + 57baf75 commit 5bba391
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
@@ -567,6 +567,7 @@ export const ORGANIZATION_POST_LIST = gql`
lastName
email
}
createdAt
}
}
`;
@@ -594,7 +595,7 @@ export const ORGANIZATION_POST_CONNECTION_LIST = gql`
lastName
email
}
pinned
createdAt
likeCount
commentCount
comments {
@@ -611,7 +612,6 @@ export const ORGANIZATION_POST_CONNECTION_LIST = gql`
}
text
}
createdAt
likedBy {
_id
firstName
2 changes: 1 addition & 1 deletion src/assets/css/app.css
Original file line number Diff line number Diff line change
@@ -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) {
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
@@ -26,9 +26,7 @@
justify-content: flex-end;
}
.icon {
transform: scale(1);
cursor: pointer;
color: #31bb6b;
margin: 1px;
}

.cards {
@@ -86,6 +84,8 @@
}
.dispflex {
display: flex;
margin-bottom: 5px;
margin-right: 5px;
}
.dispflex > input {
width: 20%;
41 changes: 37 additions & 4 deletions src/components/EventListCard/EventListCard.test.tsx
Original file line number Diff line number Diff line change
@@ -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}>
@@ -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'),
@@ -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'),
@@ -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 () => {
@@ -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);
});
@@ -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);
});
Loading

0 comments on commit 5bba391

Please sign in to comment.