1
1
import {
2
2
ActionDescriptor ,
3
+ GetTextActionOptions ,
3
4
PartialPrimitiveTargetDescriptor ,
4
5
} from "@cursorless/common" ;
5
6
import { spokenFormTest } from "./spokenFormTest" ;
@@ -135,6 +136,14 @@ const alternateHighlightNothingAction: ActionDescriptor = {
135
136
highlightId : "highlight1" ,
136
137
} ;
137
138
139
+ function getTextAction ( options : GetTextActionOptions ) : ActionDescriptor {
140
+ return {
141
+ name : "getText" ,
142
+ options,
143
+ target : decoratedPrimitiveTarget ( "a" ) ,
144
+ } ;
145
+ }
146
+
138
147
/**
139
148
* These test our Talon api using dummy spoken forms defined in
140
149
* cursorless-talon-dev/src/cursorless_test.talon
@@ -158,6 +167,26 @@ export const talonApiFixture = [
158
167
"test api wrap with snippet by name this" ,
159
168
wrapWithSnippetByNameAction ,
160
169
) ,
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
+ ) ,
161
190
spokenFormTest (
162
191
"test api extract decorated marks air past bat" ,
163
192
alternateHighlightAirAndBatAction ,
0 commit comments