From 6f900cc45d7dd7f97430812b86b5c1d1693c8ae3 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Wed, 29 Aug 2018 17:01:32 +0300 Subject: merge from ecomp a88f0072 - Modern UI Issue-ID: VID-378 Change-Id: Ibcb23dd27f550cf32ce2fe0239f0f496ae014ff6 Signed-off-by: Ittay Stern --- vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts') diff --git a/vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts b/vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts index 0bab4e1da..2583d46a1 100644 --- a/vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts +++ b/vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts @@ -1,6 +1,9 @@ export class JsonBuilder implements IJsonBuilder{ - currentValue: T; + currentValue?: T; + constructor(currentValue ?: T){ + this.currentValue = currentValue; + } public basicJson(json: JSON, url: string, status: number, delay: number, alias: string, changeResFunc?: Function) : void { this.currentValue = JSON.parse(JSON.stringify(json)); this.currentValue = changeResFunc ? changeResFunc(this.currentValue) : this.currentValue; @@ -17,9 +20,9 @@ export class JsonBuilder implements IJsonBuilder{ response: JSON.stringify(this.currentValue) }).as(alias); } - public basicMock(jsonPath: string, url: string) { + public basicMock(jsonPath: string, url: string ,changeResFunc?: Function) { cy.readFile(jsonPath).then((res) => { - this.basicJson(res, url, 200, 0, url,); + this.basicJson(res, url, 200, 0, url, changeResFunc); }) } } -- cgit 1.2.3-korg