11import {
22 ActionDescriptor ,
3+ GetTextActionOptions ,
34 PartialPrimitiveTargetDescriptor ,
45} from "@cursorless/common" ;
56import { spokenFormTest } from "./spokenFormTest" ;
@@ -135,6 +136,14 @@ const alternateHighlightNothingAction: ActionDescriptor = {
135136 highlightId : "highlight1" ,
136137} ;
137138
139+ function getTextAction ( options : GetTextActionOptions ) : ActionDescriptor {
140+ return {
141+ name : "getText" ,
142+ options,
143+ target : decoratedPrimitiveTarget ( "a" ) ,
144+ } ;
145+ }
146+
138147/**
139148 * These test our Talon api using dummy spoken forms defined in
140149 * cursorless-talon-dev/src/cursorless_test.talon
@@ -158,6 +167,26 @@ export const talonApiFixture = [
158167 "test api wrap with snippet by name this" ,
159168 wrapWithSnippetByNameAction ,
160169 ) ,
170+ spokenFormTest (
171+ "test api get text air" ,
172+ getTextAction ( { showDecorations : true , ensureSingleTarget : true } ) ,
173+ [ "apple" ] ,
174+ ) ,
175+ spokenFormTest (
176+ "test api get text list on air" ,
177+ getTextAction ( { showDecorations : true , ensureSingleTarget : false } ) ,
178+ [ "apple" ] ,
179+ ) ,
180+ spokenFormTest (
181+ "test api get text hide decorations air" ,
182+ getTextAction ( { showDecorations : false , ensureSingleTarget : true } ) ,
183+ [ "apple" ] ,
184+ ) ,
185+ spokenFormTest (
186+ "test api get text hide decorations list on air" ,
187+ getTextAction ( { showDecorations : false , ensureSingleTarget : false } ) ,
188+ [ "apple" ] ,
189+ ) ,
161190 spokenFormTest (
162191 "test api extract decorated marks air past bat" ,
163192 alternateHighlightAirAndBatAction ,
0 commit comments