Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
78 lines
1.8 KiB
TypeScript
78 lines
1.8 KiB
TypeScript
import { constructInteractionRequest } from '../../../actions/interaction/helpers';
|
|
import { createMockExecuteFunction } from '../helpers';
|
|
|
|
describe('Test Airtop interaction helpers', () => {
|
|
describe('constructInteractionRequest', () => {
|
|
it('should construct basic request with default values', () => {
|
|
const mockExecute = createMockExecuteFunction({
|
|
additionalFields: {},
|
|
});
|
|
|
|
const request = constructInteractionRequest.call(mockExecute, 0);
|
|
|
|
expect(request).toEqual({
|
|
configuration: {},
|
|
});
|
|
});
|
|
|
|
it("should include 'visualScope' parameter when specified", () => {
|
|
const mockExecute = createMockExecuteFunction({
|
|
additionalFields: {
|
|
visualScope: 'viewport',
|
|
},
|
|
});
|
|
|
|
const request = constructInteractionRequest.call(mockExecute, 0);
|
|
|
|
expect(request).toEqual({
|
|
configuration: {
|
|
visualAnalysis: {
|
|
scope: 'viewport',
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
it("should include 'waitForNavigation' parameter when specified", () => {
|
|
const mockExecute = createMockExecuteFunction({
|
|
additionalFields: {
|
|
waitForNavigation: 'load',
|
|
},
|
|
});
|
|
|
|
const request = constructInteractionRequest.call(mockExecute, 0);
|
|
|
|
expect(request).toEqual({
|
|
configuration: {
|
|
waitForNavigationConfig: {
|
|
waitUntil: 'load',
|
|
},
|
|
},
|
|
waitForNavigation: true,
|
|
});
|
|
});
|
|
|
|
it('should merge additional parameters', () => {
|
|
const mockExecute = createMockExecuteFunction({
|
|
additionalFields: {
|
|
waitForNavigation: 'load',
|
|
},
|
|
});
|
|
|
|
const request = constructInteractionRequest.call(mockExecute, 0, {
|
|
elementDescription: 'test element',
|
|
});
|
|
|
|
expect(request).toEqual({
|
|
configuration: {
|
|
waitForNavigationConfig: {
|
|
waitUntil: 'load',
|
|
},
|
|
},
|
|
waitForNavigation: true,
|
|
elementDescription: 'test element',
|
|
});
|
|
});
|
|
});
|
|
});
|