From cab7ecbc359633fc86625f8367c26dd3d851a4e2 Mon Sep 17 00:00:00 2001 From: Roman Kuznetsov Date: Mon, 21 Aug 2023 17:00:34 +0300 Subject: [PATCH] fix: property size of undefined while accepting screenshot --- lib/test-adapter.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/test-adapter.ts b/lib/test-adapter.ts index afe351f4e..f8e030610 100644 --- a/lib/test-adapter.ts +++ b/lib/test-adapter.ts @@ -365,16 +365,16 @@ export class TestAdapter { return this._errorDetails; } - getRefImg(stateName?: string): ImageData | undefined { - return _.get(_.find(this.assertViewResults, {stateName}), 'refImg'); + getRefImg(stateName?: string): ImageData | Record { + return _.get(_.find(this.assertViewResults, {stateName}), 'refImg', {}); } - getCurrImg(stateName?: string): ImageData | undefined { - return _.get(_.find(this.assertViewResults, {stateName}), 'currImg'); + getCurrImg(stateName?: string): ImageData | Record { + return _.get(_.find(this.assertViewResults, {stateName}), 'currImg', {}); } - getErrImg(): ImageBase64 | undefined { - return this.screenshot; + getErrImg(): ImageBase64 | Record { + return this.screenshot || {}; } prepareTestResult(): PrepareTestResultData {