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

add FE tests to git actions #287

Merged
merged 20 commits into from
Nov 3, 2023
2 changes: 1 addition & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Install NodeJS
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '18'

- name: Code Checkout
uses: actions/checkout@v3
Expand Down
File renamed without changes.
29 changes: 29 additions & 0 deletions .github/workflows/tests_fe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Testing FE

on: pull_request

env:
REACT_APP_BASE_API_URL: http://localhost:8000

jobs:
build_and_test:
name: Testing # job name (unique id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we test FE it's better to mention it in the name like Frontend testing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I named it 'Testing FE', because backend tests in our git actions is named 'Testing BE'

runs-on: ubuntu-latest # on which machine to run
steps: # list of steps
- name: Install NodeJS
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Code Checkout
uses: actions/checkout@v3

- name: Install Dependencies
run: |
cd FrontEnd
npm install

- name: Code Testing
run: |
cd FrontEnd
npm test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import PropTypes from 'prop-types';
const CompanyCard = ({ companyData, isAuthorized }) => {
CompanyCard.propTypes = {
companyData: PropTypes.object,
isAythorized: PropTypes.object,
isAuthorized: PropTypes.object,
};

const { mutate } = useSWRConfig();
Expand Down Expand Up @@ -49,6 +49,7 @@ const CompanyCard = ({ companyData, isAuthorized }) => {
.then((response) => {
return response.data;
});

const NewList = [];
for (let item of data.results) {
NewList.push(item['id']);
Expand Down
Loading