@@ -28,7 +28,7 @@ const { InetAddress, Uuid, Tuple } = types;
2828const ExecutionProfile = require ( '../../../../lib/execution-profile' ) . ExecutionProfile ;
2929const utils = require ( '../../../../lib/utils' ) ;
3030const graphModule = require ( '../../../../lib/datastax/graph' ) ;
31- const { asInt, asFloat, asUdt } = graphModule ;
31+ const { asInt, asFloat, asUdt, t } = graphModule ;
3232const { graphProtocol } = require ( '../../../../lib/datastax/graph/options' ) ;
3333const graphTestHelper = require ( './graph-test-helper' ) ;
3434
@@ -948,6 +948,20 @@ vdescribe('dse-5.0', 'Client @SERVER_API', function () {
948948 assert . deepEqual ( rs . toArray ( ) , [ value ] ) ;
949949 } ) ;
950950
951+ it ( 'should support elementMap() tokens' , async ( ) => {
952+ const id = schemaCounter ++ ;
953+ const insertTraversal = `g.addV('label_test').property('id', ${ id } ).property('prop_text', 'sample')` ;
954+ await client . executeGraph ( insertTraversal , null , { graphName } ) ;
955+
956+ const traversalText = `g.V().has('label_test', 'id', ${ id } ).elementMap()` ;
957+ const rs = await client . executeGraph ( traversalText , null , { graphName } ) ;
958+ const map = rs . first ( ) ;
959+ assert . strictEqual ( map . get ( 'id' ) , id ) ;
960+ assert . strictEqual ( map . get ( 'prop_text' ) , 'sample' ) ;
961+ assert . strictEqual ( typeof map . get ( t . id ) , 'string' ) ;
962+ assert . strictEqual ( map . get ( t . label ) , 'label_test' ) ;
963+ } ) ;
964+
951965 context ( 'with complex types' , ( ) => {
952966 before ( ( ) => {
953967 const createSchemaQuery = `
0 commit comments