1
1
async function createRandomTag ( environment ) {
2
2
const tagId = randomTagId ( )
3
3
const tagName = 'Tag ' + tagId
4
- console . log ( `create random tag ${ tagName } :${ tagId } ` )
5
4
return environment . createTag ( tagId , tagName )
6
5
}
7
6
@@ -24,15 +23,16 @@ async function createUpdateTagTest(t, space) {
24
23
const tagName = 'Tag ' + tagId
25
24
const environment = await space . getEnvironment ( 'master' )
26
25
const tag = await environment . createTag ( tagId , tagName )
27
- tag . name = 'new tag name'
26
+ const newTagId = 'createUpdateTagTest-' + randomTagId ( )
27
+ tag . name = newTagId
28
28
const result = await tag . update ( )
29
- t . equals ( result . name , 'new tag name' , 'tag name should be updated' )
29
+ t . equals ( result . name , newTagId , 'tag name should be updated' )
30
30
t . equals ( result . sys . id , tagId , 'tag id should be equal' )
31
31
}
32
32
async function createReadTagTest ( t , space ) {
33
33
t . plan ( 2 )
34
34
const tagId = randomTagId ( )
35
- const tagName = 'Tag ' + tagId
35
+ const tagName = 'createReadTagTest- ' + tagId
36
36
const environment = await space . getEnvironment ( 'master' )
37
37
await environment . createTag ( tagId , tagName )
38
38
const result = await environment . getTag ( tagId )
@@ -43,7 +43,7 @@ async function createReadTagTest(t, space) {
43
43
async function createReadTagsTest ( t , space ) {
44
44
t . plan ( 2 )
45
45
const tagId = randomTagId ( )
46
- const tagName = 'Tag ' + tagId
46
+ const tagName = 'createReadTagsTest- ' + tagId
47
47
const environment = await space . getEnvironment ( 'master' )
48
48
49
49
for ( let index = 0 ; index < 10 ; index ++ ) {
@@ -67,11 +67,9 @@ async function writeEntityTagsTest(t, entity, environment) {
67
67
} ,
68
68
}
69
69
entity . metadata . tags . push ( tagLink )
70
- console . log ( `entity update` )
71
70
const updatedEntity = await entity . update ( )
72
71
t . deepEqual ( updatedEntity . metadata . tags [ 0 ] , tagLink , 'tag created on entity' )
73
72
updatedEntity . metadata . tags = [ ]
74
- console . log ( `entity update` )
75
73
const noTagsEntity = await updatedEntity . update ( )
76
74
t . deepEqual ( noTagsEntity . metadata . tags , [ ] , 'tag removed from entity' )
77
75
}
0 commit comments