From e9ad15ababd9eafc1a6542f84e4f7cb9cdef9efc Mon Sep 17 00:00:00 2001 From: Kris West Date: Thu, 17 Oct 2024 11:51:29 +0100 Subject: [PATCH] fixes to several tests --- .../fdc3-agent-proxy/test/features/heartbeat.feature | 2 +- .../fdc3-agent-proxy/test/support/TestMessaging.ts | 2 +- .../test/step-definitions/desktop-agent.steps.ts | 2 +- packages/fdc3-standard/package.json | 2 +- toolbox/fdc3-for-web/fdc3-web-impl/package.json | 2 +- .../fdc3-web-impl/test/features/heartbeat.feature | 10 +++++----- .../test/step-definitions/heartbeat.steps.ts | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/fdc3-agent-proxy/test/features/heartbeat.feature b/packages/fdc3-agent-proxy/test/features/heartbeat.feature index a16203f3f..a40fece23 100644 --- a/packages/fdc3-agent-proxy/test/features/heartbeat.feature +++ b/packages/fdc3-agent-proxy/test/features/heartbeat.feature @@ -8,7 +8,7 @@ Feature: Heartbeats When messaging receives a heartbeat event And messaging will have posts | matches_type | - | heartbeatAcknowledgement | + | heartbeatAcknowledgementRequest | Scenario: Saying Goodbye When I call "{api}" with "disconnect" diff --git a/packages/fdc3-agent-proxy/test/support/TestMessaging.ts b/packages/fdc3-agent-proxy/test/support/TestMessaging.ts index 2b0da7434..061e44351 100644 --- a/packages/fdc3-agent-proxy/test/support/TestMessaging.ts +++ b/packages/fdc3-agent-proxy/test/support/TestMessaging.ts @@ -106,7 +106,7 @@ export class TestMessaging extends AbstractMessaging { constructor(channelState: { [key: string]: Context[] }) { super({ - timeout: 0, + timeoutMs: 0, channelSelector: false, intentResolver: false, dontSetWindowFdc3: false diff --git a/packages/fdc3-get-agent/test/step-definitions/desktop-agent.steps.ts b/packages/fdc3-get-agent/test/step-definitions/desktop-agent.steps.ts index 9fe6964c3..829261555 100644 --- a/packages/fdc3-get-agent/test/step-definitions/desktop-agent.steps.ts +++ b/packages/fdc3-get-agent/test/step-definitions/desktop-agent.steps.ts @@ -133,7 +133,7 @@ Given('a browser document in {string} and window in {string}', async function (t Given("the session identity is set to {string}", async function (this: CustomWorld, id: string) { const details: DesktopAgentDetails = { - agentType: WebDesktopAgentType.PROXY_PARENT, + agentType: WebDesktopAgentType.ProxyParent, instanceUuid: handleResolve(id, this), appId: 'cucumber-app', instanceId: 'uuid-0' diff --git a/packages/fdc3-standard/package.json b/packages/fdc3-standard/package.json index 4e1d6afdc..e4cc73252 100644 --- a/packages/fdc3-standard/package.json +++ b/packages/fdc3-standard/package.json @@ -19,7 +19,7 @@ "scripts": { "clean": "rimraf dist", "build": "tsc --module es2022", - "test": "tsc; jest --verbose", + "test": "tsc && jest", "lint": "eslint src/ --fix" }, "prettier": { diff --git a/toolbox/fdc3-for-web/fdc3-web-impl/package.json b/toolbox/fdc3-for-web/fdc3-web-impl/package.json index 05c07db8c..d79d33325 100644 --- a/toolbox/fdc3-for-web/fdc3-web-impl/package.json +++ b/toolbox/fdc3-for-web/fdc3-web-impl/package.json @@ -19,7 +19,7 @@ "scripts": { "clean": "rimraf dist && rimraf cucumber-report.html && rimraf coverage && rimraf .nyc_output && rimraf node_modules", "directory-openapi": "npx openapi-typescript ../../../packages/fdc3-standard/src/app-directory/specification/appd.schema.json --output generated/directory-schema.ts", - "test": "npm run directory-openapi; tsc; nyc --reporter=lcov --reporter=text cucumber-js", + "test": "npm run directory-openapi && tsc && nyc --reporter=lcov --reporter=text cucumber-js", "build": "npm run directory-openapi && tsc --module es2022" }, "dependencies": { diff --git a/toolbox/fdc3-for-web/fdc3-web-impl/test/features/heartbeat.feature b/toolbox/fdc3-for-web/fdc3-web-impl/test/features/heartbeat.feature index b9522eaf5..b8941dd14 100644 --- a/toolbox/fdc3-for-web/fdc3-web-impl/test/features/heartbeat.feature +++ b/toolbox/fdc3-for-web/fdc3-web-impl/test/features/heartbeat.feature @@ -11,15 +11,15 @@ Feature: Heartbeat Messages Between Apps and Server When "libraryApp/a1" is opened with connection id "a1" And "a1" sends validate And we wait for a period of "500" ms - And "libraryApp/a1" sends a heartbeat response + And "libraryApp/a1" sends a heartbeat response to eventUuid "a1_1" And we wait for a period of "500" ms - And "libraryApp/a1" sends a heartbeat response + And "libraryApp/a1" sends a heartbeat response to eventUuid "a1_2" And we wait for a period of "500" ms - And "libraryApp/a1" sends a heartbeat response + And "libraryApp/a1" sends a heartbeat response to eventUuid "a1_3" And we wait for a period of "500" ms - And "libraryApp/a1" sends a heartbeat response + And "libraryApp/a1" sends a heartbeat response to eventUuid "a1_4" And we wait for a period of "500" ms - And "libraryApp/a1" sends a heartbeat response + And "libraryApp/a1" sends a heartbeat response to eventUuid "a1_5" And we wait for a period of "500" ms Then I test the liveness of "libraryApp/a1" Then "{result}" is true diff --git a/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/heartbeat.steps.ts b/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/heartbeat.steps.ts index 68feed8c1..20998c63e 100644 --- a/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/heartbeat.steps.ts +++ b/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/heartbeat.steps.ts @@ -3,14 +3,14 @@ import { CustomWorld } from "../world"; import { HeartbeatAcknowledgementRequest } from "@kite9/fdc3-schema/generated/api/BrowserTypes"; import { createMeta } from "./generic.steps"; -Given('{string} sends a heartbeat response', function (this: CustomWorld, appStr: string) { +Given('{string} sends a heartbeat response to eventUuid {string}', function (this: CustomWorld, appStr: string, eventUuid: string) { const meta = createMeta(this, appStr) const uuid = this.sc.getInstanceUUID(meta.source)!! const message = { meta, payload: { - timestamp: new Date() + heartbeatEventUuid: eventUuid }, type: 'heartbeatAcknowledgementRequest' } as HeartbeatAcknowledgementRequest