@@ -1257,6 +1257,92 @@ test("annotationqueue crud", async () => {
1257
1257
}
1258
1258
} ) ;
1259
1259
1260
+ test ( "annotationqueue crud with rubric instructions" , async ( ) => {
1261
+ const client = new Client ( ) ;
1262
+ const queueName = `test-queue-${ uuidv4 ( ) . substring ( 0 , 8 ) } ` ;
1263
+ const projectName = `test-project-${ uuidv4 ( ) . substring ( 0 , 8 ) } ` ;
1264
+ const queueId = uuidv4 ( ) ;
1265
+
1266
+ try {
1267
+ // 1. Create an annotation queue
1268
+ const queue = await client . createAnnotationQueue ( {
1269
+ name : queueName ,
1270
+ description : "Initial description" ,
1271
+ queueId,
1272
+ rubricInstructions : "This is a rubric instruction" ,
1273
+ } ) ;
1274
+ expect ( queue ) . toBeDefined ( ) ;
1275
+ expect ( queue . name ) . toBe ( queueName ) ;
1276
+
1277
+ // 1a. Get the annotation queue
1278
+ const fetchedQueue = await client . readAnnotationQueue ( queue . id ) ;
1279
+ expect ( fetchedQueue ) . toBeDefined ( ) ;
1280
+ expect ( fetchedQueue . name ) . toBe ( queueName ) ;
1281
+ expect ( fetchedQueue . rubric_instructions ) . toBe (
1282
+ "This is a rubric instruction"
1283
+ ) ;
1284
+
1285
+ // 1b. Update the annotation queue rubric instructions
1286
+ const newInstructions = "Updated rubric instructions" ;
1287
+ await client . updateAnnotationQueue ( queue . id , {
1288
+ name : queueName ,
1289
+ rubricInstructions : newInstructions ,
1290
+ } ) ;
1291
+ const updatedQueue = await client . readAnnotationQueue ( queue . id ) ;
1292
+ expect ( updatedQueue . rubric_instructions ) . toBe ( newInstructions ) ;
1293
+ } finally {
1294
+ // 6. Delete the annotation queue
1295
+ await client . deleteAnnotationQueue ( queueId ) ;
1296
+
1297
+ // Clean up the project
1298
+ if ( await client . hasProject ( { projectName } ) ) {
1299
+ await client . deleteProject ( { projectName } ) ;
1300
+ }
1301
+ }
1302
+ } ) ;
1303
+
1304
+ test ( "annotationqueue crud with rubric instructions 2" , async ( ) => {
1305
+ const client = new Client ( ) ;
1306
+ const queueName = `test-queue-${ uuidv4 ( ) . substring ( 0 , 8 ) } ` ;
1307
+ const projectName = `test-project-${ uuidv4 ( ) . substring ( 0 , 8 ) } ` ;
1308
+ const queueId = uuidv4 ( ) ;
1309
+
1310
+ try {
1311
+ // 1. Create an annotation queue
1312
+ const queue = await client . createAnnotationQueue ( {
1313
+ name : queueName ,
1314
+ description : "Initial description" ,
1315
+ queueId,
1316
+ } ) ;
1317
+ expect ( queue ) . toBeDefined ( ) ;
1318
+ expect ( queue . name ) . toBe ( queueName ) ;
1319
+ expect ( queue . rubric_instructions ) . toBeUndefined ( ) ;
1320
+
1321
+ // 1a. Get the annotation queue
1322
+ const fetchedQueue = await client . readAnnotationQueue ( queue . id ) ;
1323
+ expect ( fetchedQueue ) . toBeDefined ( ) ;
1324
+ expect ( fetchedQueue . name ) . toBe ( queueName ) ;
1325
+ expect ( fetchedQueue . rubric_instructions ) . toBeNull ( ) ;
1326
+
1327
+ // 1b. Update the annotation queue rubric instructions
1328
+ const newInstructions = "Updated rubric instructions" ;
1329
+ await client . updateAnnotationQueue ( queue . id , {
1330
+ name : queueName ,
1331
+ rubricInstructions : newInstructions ,
1332
+ } ) ;
1333
+ const updatedQueue = await client . readAnnotationQueue ( queue . id ) ;
1334
+ expect ( updatedQueue . rubric_instructions ) . toBe ( newInstructions ) ;
1335
+ } finally {
1336
+ // 6. Delete the annotation queue
1337
+ await client . deleteAnnotationQueue ( queueId ) ;
1338
+
1339
+ // Clean up the project
1340
+ if ( await client . hasProject ( { projectName } ) ) {
1341
+ await client . deleteProject ( { projectName } ) ;
1342
+ }
1343
+ }
1344
+ } ) ;
1345
+
1260
1346
test ( "upload examples multipart" , async ( ) => {
1261
1347
const client = new Client ( ) ;
1262
1348
const datasetName = `__test_upload_examples_multipart${ uuidv4 ( ) . slice ( 0 , 4 ) } ` ;
0 commit comments