@@ -1131,3 +1131,57 @@ test.concurrent('promote monolith schema version succeeds', async ({ expect }) =
11311131 } ) ;
11321132 expect ( promotedVersionDetails . sdl ) . toContain ( 'b: String!' ) ;
11331133} ) ;
1134+
1135+ test . concurrent . only ( 'promote monolith version to empty target' , async ( ) => {
1136+ const { createOrg } = await initSeed ( ) . createOwner ( ) ;
1137+ const { createProject, createOrganizationAccessToken } = await createOrg ( ) ;
1138+ const { target, fetchVersions, createTarget } = await createProject ( ProjectType . Single ) ;
1139+ const otherTarget = await createTarget ( ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
1140+ const { privateAccessKey } = await createOrganizationAccessToken ( {
1141+ resources : {
1142+ mode : ResourceAssignmentModeType . All ,
1143+ } ,
1144+ permissions : [
1145+ 'schemaVersion:publish' ,
1146+ 'target:modifySettings' ,
1147+ 'project:describe' ,
1148+ 'schemaVersion:promote' ,
1149+ ] ,
1150+ } ) ;
1151+
1152+ let promoteResult = await publishSchema (
1153+ {
1154+ author : 'a' ,
1155+ commit : 'a' ,
1156+ sdl : /* GraphQL */ `
1157+ type Query {
1158+ a: String!
1159+ }
1160+ ` ,
1161+ target : {
1162+ byId : target . id ,
1163+ } ,
1164+ } ,
1165+ privateAccessKey ,
1166+ ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
1167+
1168+ const [ versionToPromote ] = await fetchVersions ( 2 ) ;
1169+
1170+ assertNonNullish ( otherTarget . createTarget . ok ) ;
1171+ await schemaVersionPromote (
1172+ {
1173+ source : {
1174+ fromSchemaVersionById : versionToPromote . id ,
1175+ } ,
1176+ target : {
1177+ toTarget : {
1178+ byId : otherTarget . createTarget . ok . createdTarget . id ,
1179+ } ,
1180+ } ,
1181+ } ,
1182+ privateAccessKey ,
1183+ ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
1184+
1185+ expect ( promoteResult . schemaVersionPromote . error ) . toEqual ( null ) ;
1186+ assertNonNullish ( promoteResult . schemaVersionPromote . ok ) ;
1187+ } ) ;
0 commit comments