feat(Airtop Node): Add Airtop node (#13809)

This commit is contained in:
Cesar Sanchez
2025-04-01 21:51:04 +02:00
committed by GitHub
parent cf37ee3ced
commit a7a165dda2
48 changed files with 5026 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
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',
});
});
});
});