From 4a30fb8d61873c4df431ca68b93bcacee9d8fcbf Mon Sep 17 00:00:00 2001 From: aryangupta701 Date: Sat, 26 Aug 2023 16:28:16 +0530 Subject: [PATCH] fixed typo Signed-off-by: aryangupta701 --- source/ContentScript/recorder.ts | 6 +++--- source/types/zestScript/ZestStatement.ts | 4 ++-- test/ContentScript/unitTests.test.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/ContentScript/recorder.ts b/source/ContentScript/recorder.ts index 0d28f7a..b1cb49d 100644 --- a/source/ContentScript/recorder.ts +++ b/source/ContentScript/recorder.ts @@ -24,7 +24,7 @@ import { ZestStatementElementClick, ZestStatementElementSendKeys, ZestStatementLaunchBrowser, - ZestStatementSwichToFrame, + ZestStatementSwitchToFrame, } from '../types/zestScript/ZestStatement'; import {getPath} from './util'; import {ZEST_SCRIPT} from '../utils/constants'; @@ -53,14 +53,14 @@ class Recorder { } if (this.curLevel > level) { while (this.curLevel > level) { - this.sendZestScriptToZAP(new ZestStatementSwichToFrame(-1)); + this.sendZestScriptToZAP(new ZestStatementSwitchToFrame(-1)); this.curLevel -= 1; } this.curFrame = frameIndex; } else { this.curLevel += 1; this.curFrame = frameIndex; - this.sendZestScriptToZAP(new ZestStatementSwichToFrame(frameIndex)); + this.sendZestScriptToZAP(new ZestStatementSwitchToFrame(frameIndex)); } if (this.curLevel !== level) { console.log('Error in switching frames'); diff --git a/source/types/zestScript/ZestStatement.ts b/source/types/zestScript/ZestStatement.ts index 0d4af36..f9b3355 100644 --- a/source/types/zestScript/ZestStatement.ts +++ b/source/types/zestScript/ZestStatement.ts @@ -189,7 +189,7 @@ class ZestStatementWindowClose extends ZestStatement { } } -class ZestStatementSwichToFrame extends ZestStatement { +class ZestStatementSwitchToFrame extends ZestStatement { frameIndex: number; frameName: string; @@ -238,7 +238,7 @@ export { ZestStatementLaunchBrowser, ZestStatementElementMouseOver, ZestStatementElementClick, - ZestStatementSwichToFrame, + ZestStatementSwitchToFrame, ZestStatementElementSendKeys, ZestStatementElementClear, ZestStatementWindowClose, diff --git a/test/ContentScript/unitTests.test.ts b/test/ContentScript/unitTests.test.ts index 4485a09..fda8d71 100644 --- a/test/ContentScript/unitTests.test.ts +++ b/test/ContentScript/unitTests.test.ts @@ -28,7 +28,7 @@ import { ElementLocator, ZestStatementElementClick, ZestStatementElementSendKeys, - ZestStatementSwichToFrame, + ZestStatementSwitchToFrame, } from '../../source/types/zestScript/ZestStatement'; jest.mock('webextension-polyfill'); @@ -461,12 +461,12 @@ test('should return correct path for element with XPath', () => { }); test('should generate valid frame switch statement', () => { - const zestStatementSwichToFrame = new ZestStatementSwichToFrame( + const zestStatementSwitchToFrame = new ZestStatementSwitchToFrame( 0, 'testvalue' ); - expect(zestStatementSwichToFrame.toJSON()).toBe( + expect(zestStatementSwitchToFrame.toJSON()).toBe( '{"windowHandle":"windowHandle1","frameIndex":0,"frameName":"testvalue","parent":false,"index":-1,"enabled":true,"elementType":"ZestClientSwitchToFrame"}' ); });