Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-bao committed Jul 5, 2022
1 parent 2d717e9 commit d01af7e
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"userCredentials":{"username":"test-superUser"},"authorities":[]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"meta":{"allowPublicAccess":false,"allowExternalAccess":false},"object":{"id":"XFjvfUkYdp1","name":"0001_KBC_TX_CURR_ARTDISP_3 TO 5 months","displayName":"0001_KBC_TX_CURR_ARTDISP_3 TO 5 months","publicAccess":"r-------","user":{"id":"bRlrnaZAmgw","name":"KOUADIO BOITINI CHARLES"},"userGroupAccesses":[],"userAccesses":[],"externalAccess":false}}

This file was deleted.

28 changes: 14 additions & 14 deletions search/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@mui/icons-material": "^5.8.3",
"@mui/material": "^5.8.4",
"@mui/x-date-pickers": "^5.0.0-alpha.6",
"@pepfar-react-lib/datim-api": "^0.0.12",
"@pepfar-react-lib/testwrap": "^0.0.10",
"@pepfar-react-lib/datim-api": "^0.0.13",
"@pepfar-react-lib/testwrap": "^0.0.11",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^13.5.0",
Expand Down
2 changes: 1 addition & 1 deletion search/src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ global.fetch = fetch;
//@ts-ignore
global.TextDecoder = TextDecoder;
datimApi.register(process.env.NODE_ENV, process.env.REACT_APP_BASE_URL)
datimApi.setTestUsername(`jflaska`,`Basic amZsYXNrYTpHcmVlbjE4IQ==`);
datimApi.setTestUsername(`jflaska`,`Basic dGVzdC1zdXBlclVzZXI6UGFzc3dvcmQxMjM=`);
jest.setTimeout(20000);
29 changes: 29 additions & 0 deletions search/src/test/8.nonSuShare.tes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import datimApi from "@pepfar-react-lib/datim-api";
import {renderSearch} from "./lib/shared.testLib";

let searchUrl:string = `/sqlViews/VisNavgSrch/data?paging=false&var=uid:_,favoriteName:_,user:_,visualizationType:_,minViewCount:-1,maxViewCount:9223372036854776000,lastViewedMinDate:1969-01-01,lastViewedMaxDate:2100-01-01,limitViewsMinDate:1969-01-01,limitViewsMaxDate:2100-01-01,limit:100,includeNeverViewed:1`
let searchResponse = {
"listGrid": {
"rows": [
[
"n0CaxnRk0Pn",
"test visualization",
1,
"2022-01-01",
"chart",
"",
"enhanced"
]
]
}
}

test(`8 > Non SuperUser share`, async ()=>{
renderSearch();
datimApi.registerGetMock(searchUrl,)
search();
})

function search() {
throw new Error("Function not implemented.");
}
25 changes: 25 additions & 0 deletions search/testData/loadTestUsers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// import {loadUsers} from "@pepfar-react-lib/dhis2-loader/jsbuild";
let loadUsers = require("@pepfar-react-lib/dhis2-loader").loadUsers;
let superUser = {
id: 'testSuperUs',
name: 'Test SuperUser',
firstName: 'Test',
surname:'SuperUser',
userCredentials: {
username: 'test-superUser',
password: 'Password123',
},
authorities: ['ALL']
};
let superUser = {
id: 'testSuperUs',
name: 'Test SuperUser',
firstName: 'Test',
surname:'SuperUser',
userCredentials: {
username: 'test-superUser',
password: 'Password123',
},
authorities: ['ALL']
}
loadUsers([superUser],'jakub.datim.org','Basic amZsYXNrYTpHcmVlbjE4IQ==')
16 changes: 8 additions & 8 deletions search/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2547,10 +2547,10 @@
"@nodelib/fs.scandir" "2.1.5"
"fastq" "^1.6.0"

"@pepfar-react-lib/datim-api@^0.0.12":
"integrity" "sha512-VhtLsAn7a9XkXG/eI4ukc9nA2r79gNOJSTVpes3ZUTmb8cdoYhciv2XQRNhJ2mZRnq9K0KGI2caf9TfP6HZkuw=="
"resolved" "https://registry.npmjs.org/@pepfar-react-lib/datim-api/-/datim-api-0.0.12.tgz"
"version" "0.0.12"
"@pepfar-react-lib/datim-api@^0.0.13":
"integrity" "sha512-Wl13b17vqSCGeRHjHAsoJpLYQmZY3DDgY9+y9TpU3sf7uiY069S2mguVyeKMZP6Ztha+F1tOPOaLrJ9mu+6Ibg=="
"resolved" "https://registry.npmjs.org/@pepfar-react-lib/datim-api/-/datim-api-0.0.13.tgz"
"version" "0.0.13"
dependencies:
"md5" "^2.3.0"
"node-fetch" "^3.2.4"
Expand All @@ -2567,10 +2567,10 @@
"cpx" "^1.5.0"
"jsonfile" "^6.1.0"

"@pepfar-react-lib/testwrap@^0.0.10":
"integrity" "sha512-J9kkzjUl7RWcf565w1v8zlf4Rd7f5sxRNXFqL6v+YNgkM/wFbxzYezgBiKXR5SndqvPFR96xt0qMPIujFDY1Eg=="
"resolved" "https://registry.npmjs.org/@pepfar-react-lib/testwrap/-/testwrap-0.0.10.tgz"
"version" "0.0.10"
"@pepfar-react-lib/testwrap@^0.0.11":
"integrity" "sha512-mOMbLePZ3GIRjef41SMY1tia6XLzWXLQcjmUO+XJbY8BbplJnsAeWEoY9VXvuj+gYVGXTJsTKHMUdysC3MKT/Q=="
"resolved" "https://registry.npmjs.org/@pepfar-react-lib/testwrap/-/testwrap-0.0.11.tgz"
"version" "0.0.11"

"@pmmmwh/react-refresh-webpack-plugin@^0.5.3":
"integrity" "sha512-bcKCAzF0DV2IIROp9ZHkRJa6O4jy7NlnHdWL3GmcUxYWNjLXkK5kfELELwEfSP5hXPfVL/qOGMAROuMQb9GG8Q=="
Expand Down

0 comments on commit d01af7e

Please sign in to comment.