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 actions for unit tests #516

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from
Open
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
36 changes: 36 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- run: npm install
- run: npm ci
- run: yarn install
#- run: npm run build --if-present
#- run: yarn install
#- run: yarn start
- run: yarn test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"axios": "^0.21.1",
"axios": "^0.21.2",
"bootstrap": "^4.4.1",
"font-awesome": "^4.7.0",
"highcharts": "^8.2.2",
Expand Down
4 changes: 2 additions & 2 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const CACHING = {

export const LOADING_DELAY = 200;

export const GA_TRACKING_ID = 'UA-137589703-1';
export const GA_TRACKING_ID = 'UA-137589703-2';

export const DWH_API_URL = 'https://data.kenyahmis.org:8082';
export const DWH_API_URL = 'https://dwh.nascop.org';
export const HRH_API_URL = 'https://hrh.datacompanion.org';
4 changes: 2 additions & 2 deletions src/containers/DefaultLayout/DefaultHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const DefaultHeader = () => {
const Adhoc = () => {
return (
<NavItem className="px-3">
<a href="https://data.kenyahmis.org:9090/" className="nav-link active"><strong>Adhoc</strong></a>
<a href="https://dwh.nascop.org:7010/" className="nav-link active"><strong>Adhoc</strong></a>
</NavItem>
);
};
Expand All @@ -134,7 +134,7 @@ const Administration = (userType) => {
<DropdownToggle nav caret><strong>Administration</strong></DropdownToggle>
<DropdownMenu right>
{ userType.userType === 1 ? <DropdownItem><Link to="/administration/organizations" className="nav-link">Organizations</Link></DropdownItem> : '' }
<DropdownItem><a href="https://auth.kenyahmis.org/DwhIdentity/Users" className="nav-link">Users</a></DropdownItem>
<DropdownItem><a href="https://auth.kenyahmis.org/nascop/Users" className="nav-link">Users</a></DropdownItem>
</DropdownMenu>
</UncontrolledDropdown>
);
Expand Down
8 changes: 4 additions & 4 deletions src/services/UserService.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ let config = {};

if(process.env.NODE_ENV.trim() === 'production') {
config = {
authority: "https://auth.kenyahmis.org/dwhidentity",
client_id: "dwh.spa",
redirect_uri: "https://data.kenyahmis.org:9000/#/signin-oidc#",
authority: "https://auth.kenyahmis.org/nascop",
client_id: "nascop.spa",
redirect_uri: "https://dwh.nascop.org/#/signin-oidc#",
response_type: "id_token token",
scope: "openid profile apiApp",
post_logout_redirect_uri: "https://data.kenyahmis.org:9000",
post_logout_redirect_uri: "https://dwh.nascop.org",
}
} else {
config = {
Expand Down
4 changes: 2 additions & 2 deletions src/views/Shared/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ let url = null;
let url_identity = null;

if(process.env.NODE_ENV.trim() === 'production') {
url = 'https://data.kenyahmis.org:8082/api/';
url_identity = 'https://auth.kenyahmis.org/DwhIdentity/api/';
url = 'api/';
url_identity = 'https://auth.kenyahmis.org/nascop/api/';
} else {
url = 'http://localhost:7000/api/';
url_identity = 'https://localhost:5006/api/';
Expand Down
30 changes: 15 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2846,12 +2846,12 @@ axe-core@^4.0.2:
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.2.0.tgz#6594db4ee62f78be79e32a7295d21b099b60668d"
integrity sha512-1uIESzroqpaTzt9uX48HO+6gfnKu3RwvWdCcWSrX4csMInJfCo1yvKPNXCwXFRpJqRW25tiASb6No0YH57PXqg==

axios@^0.21.1:
version "0.21.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
axios@^0.21.2:
version "0.21.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.2.tgz#21297d5084b2aeeb422f5d38e7be4fbb82239017"
integrity sha512-87otirqUw3e8CzHTMO+/9kh/FSgXt/eVDvipijwDtEuwbkySWZ9SBm6VEubmJ/kLKEoLQV/POhxXFb66bfekfg==
dependencies:
follow-redirects "^1.10.0"
follow-redirects "^1.14.0"

axobject-query@^2.2.0:
version "2.2.0"
Expand Down Expand Up @@ -5486,10 +5486,10 @@ flush-write-stream@^1.0.0:
inherits "^2.0.3"
readable-stream "^2.3.6"

follow-redirects@^1.0.0, follow-redirects@^1.10.0:
version "1.13.3"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.3.tgz#e5598ad50174c1bc4e872301e82ac2cd97f90267"
integrity sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==
follow-redirects@^1.0.0, follow-redirects@^1.14.0:
version "1.14.5"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.5.tgz#f09a5848981d3c772b5392309778523f8d85c381"
integrity sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==

font-awesome@^4.7.0:
version "4.7.0"
Expand Down Expand Up @@ -7869,9 +7869,9 @@ minipass-pipeline@^1.2.2:
minipass "^3.0.0"

minipass@^3.0.0, minipass@^3.1.1:
version "3.1.3"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.3.tgz#7d42ff1f39635482e15f9cdb53184deebd5815fd"
integrity sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==
version "3.1.5"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.5.tgz#71f6251b0a33a49c01b3cf97ff77eda030dff732"
integrity sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==
dependencies:
yallist "^4.0.0"

Expand Down Expand Up @@ -11362,9 +11362,9 @@ tapable@^1.0.0, tapable@^1.1.3:
integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==

tar@^6.0.2:
version "6.1.0"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.0.tgz#d1724e9bcc04b977b18d5c573b333a2207229a83"
integrity sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==
version "6.1.11"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621"
integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==
dependencies:
chownr "^2.0.0"
fs-minipass "^2.0.0"
Expand Down