Skip to content

Commit

Permalink
Merge pull request #69 from aryangupta701/fix-type
Browse files Browse the repository at this point in the history
Fixed a small typo
  • Loading branch information
thc202 authored Aug 26, 2023
2 parents f4bd972 + 4a30fb8 commit b8eaab9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions source/ContentScript/recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
ZestStatementElementClick,
ZestStatementElementSendKeys,
ZestStatementLaunchBrowser,
ZestStatementSwichToFrame,
ZestStatementSwitchToFrame,
} from '../types/zestScript/ZestStatement';
import {getPath} from './util';
import {ZEST_SCRIPT} from '../utils/constants';
Expand Down Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions source/types/zestScript/ZestStatement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class ZestStatementWindowClose extends ZestStatement {
}
}

class ZestStatementSwichToFrame extends ZestStatement {
class ZestStatementSwitchToFrame extends ZestStatement {
frameIndex: number;

frameName: string;
Expand Down Expand Up @@ -238,7 +238,7 @@ export {
ZestStatementLaunchBrowser,
ZestStatementElementMouseOver,
ZestStatementElementClick,
ZestStatementSwichToFrame,
ZestStatementSwitchToFrame,
ZestStatementElementSendKeys,
ZestStatementElementClear,
ZestStatementWindowClose,
Expand Down
6 changes: 3 additions & 3 deletions test/ContentScript/unitTests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
ElementLocator,
ZestStatementElementClick,
ZestStatementElementSendKeys,
ZestStatementSwichToFrame,
ZestStatementSwitchToFrame,
} from '../../source/types/zestScript/ZestStatement';

jest.mock('webextension-polyfill');
Expand Down Expand Up @@ -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"}'
);
});

0 comments on commit b8eaab9

Please sign in to comment.