Skip to content

Commit

Permalink
Merge branch 'PalisadoesFoundation:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
JamarTG authored Nov 26, 2023
2 parents 6695392 + 962e995 commit 38379ca
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ This section can be deleted after reading.
We employ the following branching strategy to simplify the development process and to ensure that only stable code is pushed to the `master` branch:
- `develop`: For unstable code: New features and bug fixes.
- `alpha-x.x.x`: For stability testing: Only bug fixes accepted.
- `master`: Where the stable production ready code lies. Only security related bugs.
NOTE!!!
ONLY SUBMIT PRS AGAINST OUR `DEVELOP` BRANCH. THE DEFAULT IS `MAIN`, SO YOU WILL HAVE TO MODIFY THIS BEFORE SUBMITTING YOUR PR FOR REVIEW. PRS MADE AGAINST `MAIN` WILL BE CLOSED.
-->

<!--
Expand Down
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ Make sure you are following [issue report guidelines](ISSUE_GUIDELINES.md) avail

#### Branching Strategy

For Talawa Admin, we had employed the following branching strategy to simplify the development process and to ensure that only stable code is pushed to the `master` branch:
For Talawa Admin, we had employed the following branching strategy to simplify the development process and to ensure that only stable code is pushed to the `main` branch:

- `develop`: For unstable code and bug fixing
- `alpha-x.x.x`: for stability teesting
- `master`: Where the stable production ready code lies
- `main`: Where the stable production ready code lies. This is our default branch.

#### Conflict Resolution

Expand Down
4 changes: 4 additions & 0 deletions PR_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ npm run format:check
1. Please read our [CONTRIBUTING.md](CONTRIBUTING.md) document for details on our testing policy.

## Pull Request Processing
These are key guidelines for the procedure:

### Only submit PRs against our `develop` branch, not the default `main` branch

1. Only submit PRs against our `develop` branch. The default is `main`, so you will have to modify this before submitting your PR for review. PRs made against `main` will be closed.
1. We do not accept draft Pull Requests. They will be closed if submitted. We focus on work that is ready for immediate review.
1. Removing assigned reviewers from your Pull Request will cause it to be closed. The quality of our code is very important to us. Therefore we make experienced maintainers of our code base review your code. Removing these assigned persons is not in the best interest of this goal.
1. If you have not done so already, please read the `Pull Requests and Issues` and `Testing` sections above.
Expand Down
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import Settings from 'screens/UserPortal/Settings/Settings';
import Donate from 'screens/UserPortal/Donate/Donate';
import Events from 'screens/UserPortal/Events/Events';
import Tasks from 'screens/UserPortal/Tasks/Tasks';
// import Chat from 'screens/UserPortal/Chat/Chat';
import Advertisements from 'components/Advertisements/Advertisements';
import Chat from 'screens/UserPortal/Chat/Chat';

function app(): JSX.Element {
/*const { updatePluginLinks, updateInstalled } = bindActionCreators(
Expand Down Expand Up @@ -130,7 +130,7 @@ function app(): JSX.Element {
<SecuredRouteForUser path="/user/donate" component={Donate} />
<SecuredRouteForUser path="/user/events" component={Events} />
<SecuredRouteForUser path="/user/tasks" component={Tasks} />
<SecuredRouteForUser path="/user/chat" component={Chat} />
{/* <SecuredRouteForUser path="/user/chat" component={Chat} /> */}

<Route exact path="*" component={PageNotFound} />
</Switch>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('Testing OrganizationNavbar Component [User Portal]', () => {
expect(screen.getByText('People')).toBeInTheDocument();
expect(screen.getByText('Events')).toBeInTheDocument();
expect(screen.getByText('Donate')).toBeInTheDocument();
expect(screen.getByText('Chat')).toBeInTheDocument();
// expect(screen.getByText('Chat')).toBeInTheDocument();
});

test('The language is switched to English', async () => {
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('Testing OrganizationNavbar Component [User Portal]', () => {
expect(screen.getByText('People')).toBeInTheDocument();
expect(screen.getByText('Events')).toBeInTheDocument();
expect(screen.getByText('Donate')).toBeInTheDocument();
expect(screen.getByText('Chat')).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 @@ -84,13 +84,13 @@ function organizationNavbar(props: InterfaceNavbarProps): JSX.Element {
translated: t('donate'),
view: true,
},
{
pluginName: 'Chats',
alias: 'chat',
link: `/user/chat/id=${organizationId}`,
translated: t('chat'),
view: true,
},
// {
// pluginName: 'Chats',
// alias: 'chat',
// link: `/user/chat/id=${organizationId}`,
// translated: t('chat'),
// view: true,
// },
];
if (localStorage.getItem('talawaPlugins')) {
const talawaPlugins: string = localStorage.getItem('talawaPlugins') || '{}';
Expand Down
127 changes: 127 additions & 0 deletions src/components/UserPortal/PromotedPost/PromotedPost.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
import React from 'react';
import { act, render, waitFor } 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 PromotedPost from './PromotedPost';

const link = new StaticMockLink([], true);

async function wait(ms = 100): Promise<void> {
await act(() => {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
});
}

let props = {
id: '1',
image: '',
title: 'Test Post',
};

describe('Testing PromotedPost Test', () => {
test('Component should be rendered properly', async () => {
render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<Provider store={store}>
<I18nextProvider i18n={i18nForTest}>
<PromotedPost {...props} />
</I18nextProvider>
</Provider>
</BrowserRouter>
</MockedProvider>
);

await wait();
});

test('Component should be rendered properly if prop image is not undefined', async () => {
props = {
...props,
image: 'promotedPostImage',
};

render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<Provider store={store}>
<I18nextProvider i18n={i18nForTest}>
<PromotedPost {...props} />
</I18nextProvider>
</Provider>
</BrowserRouter>
</MockedProvider>
);

await wait();
});
});

test('Component should display the icon correctly', async () => {
const { queryByTestId } = render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<Provider store={store}>
<I18nextProvider i18n={i18nForTest}>
<PromotedPost {...props} />
</I18nextProvider>
</Provider>
</BrowserRouter>
</MockedProvider>
);

await waitFor(() => {
const icon = queryByTestId('StarPurple500Icon');
expect(icon).toBeInTheDocument();
});
});

test('Component should display the text correctly', async () => {
const { queryAllByText } = render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<Provider store={store}>
<I18nextProvider i18n={i18nForTest}>
<PromotedPost {...props} />
</I18nextProvider>
</Provider>
</BrowserRouter>
</MockedProvider>
);

await waitFor(() => {
const title = queryAllByText('Test Post') as HTMLElement[];
expect(title[0]).toBeInTheDocument();
});
});

test('Component should display the image correctly', async () => {
props = {
...props,
image: 'promotedPostImage',
};
const { queryByRole } = render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<Provider store={store}>
<I18nextProvider i18n={i18nForTest}>
<PromotedPost {...props} />
</I18nextProvider>
</Provider>
</BrowserRouter>
</MockedProvider>
);

await waitFor(() => {
const image = queryByRole('img');
expect(image).toHaveAttribute('src', 'promotedPostImage');
});
});
17 changes: 13 additions & 4 deletions src/screens/MemberDetail/MemberDetail.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@

.justifysp {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
/* gap : 2px; */
}

.flexclm {
Expand All @@ -126,8 +129,7 @@
.justifysp {
padding-left: 55px;
display: flex;
justify-content: space-between;
width: 100%;
justify-content: space-evenly;
}

.mainpageright {
Expand Down Expand Up @@ -355,12 +357,19 @@
}

.userImage {
width: 200px;
height: 200px;
width: 180px;
height: 180px;
object-fit: cover;
border-radius: 8px;
}

@media only screen and (max-width: 1200px) {
.userImage {
width: 100px;
height: 100px;
}
}

.activeBtn {
width: 100%;
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/screens/MemberDetail/MemberDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const MemberDetail: React.FC<MemberDetailProps> = ({ id }): JSX.Element => {
<Col sm={6} lg={8}>
{/* User section */}
<div>
<h2 className="mt-3 mb-4">
<h2>
<strong>
{userData?.user?.firstName} {userData?.user?.lastName}
</strong>
Expand Down

0 comments on commit 38379ca

Please sign in to comment.