Skip to content

Commit

Permalink
Using web client
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat committed May 16, 2024
1 parent 7758071 commit 1ec9ef4
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 10 deletions.
120 changes: 120 additions & 0 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"compile": "webpack build",
"replace-glue-core": "npm run copy && npx replace-in-file --configFile=options/glue-core-app-1.2.js && npx replace-in-file --configFile=options/glue-core-support-1.2.js && npx replace-in-file --configFile=options/glue-core-app-2.0.js && npx replace-in-file --configFile=options/glue-core-support-2.0.js",
"replace-glue-core-plus": "npm run copy && npx replace-in-file --configFile=options/glue-core-plus-app-2.0.js && npx replace-in-file --configFile=options/glue-core-support-2.0.js",
"copy-glue-libs" : "shx cp -R options/glue/* ./dist",
"copy-glue-libs": "shx cp -R options/glue/* ./dist",
"replace-connectifi": "npm run copy && npx replace-in-file --configFile=options/connectifi-adapter.js",
"serve": "npx http-server ./dist -p 3001 -c-1",
"start": "npm run copy && npm run compile && npm run serve",
Expand All @@ -15,6 +15,7 @@
"build-static": "npm run compile && npm run copy"
},
"dependencies": {
"@kite9/client": "0.0.17",
"buffer": "^6.0.3",
"chai": "^4.3.6",
"fdc3_1_2": "npm:@finos/fdc3@^1.2.0",
Expand All @@ -40,4 +41,4 @@
"webpack": "^5.69.1",
"webpack-cli": "^4.9.2"
}
}
}
3 changes: 2 additions & 1 deletion src/mock/v1.2/mock-functions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DesktopAgent } from "fdc3_1_2/dist/api/DesktopAgent";
import constants from "../../constants";
import { AppControlContext } from "../../context-types";
import { fdc3Ready } from "@kite9/client";

declare let fdc3: DesktopAgent;

Expand All @@ -9,7 +10,7 @@ export const onFdc3Ready = () =>
if (window.fdc3) {
resolve(undefined);
} else {
window.addEventListener("fdc3Ready", () => resolve(undefined));
fdc3Ready().then(() => resolve(undefined));
}
});

Expand Down
3 changes: 2 additions & 1 deletion src/mock/v2.0/mock-functions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DesktopAgent } from "fdc3_2_0/dist/api/DesktopAgent";
import constants from "../../constants";
import { AppControlContext } from "../../context-types";
import { fdc3Ready } from "@kite9/client";

declare let fdc3: DesktopAgent;

Expand All @@ -9,7 +10,7 @@ export const onFdc3Ready = () =>
if (window.fdc3) {
resolve(undefined);
} else {
window.addEventListener("fdc3Ready", () => resolve(undefined));
fdc3Ready().then(() => resolve(undefined));
}
});

Expand Down
3 changes: 2 additions & 1 deletion src/test/v1.2/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { fdc3Ready } from "@kite9/client";
import { getPackMembers, getPackNames, executeTestsInBrowser } from "./testSuite";

require("mocha/mocha.css");
Expand Down Expand Up @@ -29,7 +30,7 @@ function executeTests() {
if (window.fdc3) {
action();
} else {
window.addEventListener("fdc3Ready", action);
fdc3Ready().then(() => action());
}
}

Expand Down
9 changes: 5 additions & 4 deletions src/test/v2.0/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from "./testSuite";
import { fdc3Ready } from "@kite9/client";
import { getPackMembers, getPackNames, executeTestsInBrowser, executeManualTestsInBrowser } from "./testSuite";

require("mocha/mocha.css");
Expand Down Expand Up @@ -30,7 +31,7 @@ function executeTests() {
if (window.fdc3) {
action();
} else {
window.addEventListener("fdc3Ready", action);
fdc3Ready().then(() => action());
}
}

Expand All @@ -39,12 +40,12 @@ function executeManualTests() {
toggleBackButton();
const manualTests = document.getElementById("manualTests") as HTMLSelectElement;
var selectedManualTest = manualTests.options[manualTests.selectedIndex].innerHTML;
console.log('******** Selected manual test is',selectedManualTest);
console.log('******** Selected manual test is', selectedManualTest);
const action = () => executeManualTestsInBrowser(selectedManualTest);
if (window.fdc3) {
action();
} else {
window.addEventListener("fdc3Ready", action);
fdc3Ready().then(() => action());
}
}

Expand All @@ -54,7 +55,7 @@ function returnToTestSelection() {

function toggleVersionSelector() {
const versionSelector = document.getElementById("version-selector");
const manualSelector = document.getElementById("manualTests-selector");
const manualSelector = document.getElementById("manualTests-selector");
if (versionSelector.style.display === "none") {
versionSelector.style.display = "block";
manualSelector.style.display = "block";
Expand Down
2 changes: 1 addition & 1 deletion static/v1.2/lib/mock-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const onFdc3Ready = () =>
if (window.fdc3) {
resolve();
} else {
window.addEventListener("fdc3Ready", () => resolve());
fdc3Ready().then(() => resolve());
}
});

Expand Down

0 comments on commit 1ec9ef4

Please sign in to comment.