@@ -16,12 +16,10 @@ test.describe('POST /v1/template', () => {
1616 const authHelper = createAuthHelper ( ) ;
1717 const templateStorageHelper = new TemplateStorageHelper ( ) ;
1818 let user1 : TestUser ;
19- let userNoClient : TestUser ;
2019 let userDirectOwner : TestUser ;
2120
2221 test . beforeAll ( async ( ) => {
2322 user1 = await authHelper . getTestUser ( testUsers . User1 . userId ) ;
24- userNoClient = await authHelper . getTestUser ( testUsers . User6 . userId ) ;
2523 userDirectOwner = await authHelper . getTestUser ( testUsers . User7 . userId ) ;
2624 } ) ;
2725
@@ -827,55 +825,6 @@ test.describe('POST /v1/template', () => {
827825 } ) ;
828826
829827 test . describe ( 'user-owned templates' , ( ) => {
830- test ( 'user without a clientId assigned can create a template' , async ( {
831- request,
832- } ) => {
833- const template = TemplateAPIPayloadFactory . getCreateTemplatePayload ( {
834- templateType : 'NHS_APP' ,
835- } ) ;
836-
837- const start = new Date ( ) ;
838-
839- const response = await request . post (
840- `${ process . env . API_BASE_URL } /v1/template` ,
841- {
842- headers : {
843- Authorization : await userNoClient . getAccessToken ( ) ,
844- } ,
845- data : template ,
846- }
847- ) ;
848-
849- expect ( response . status ( ) ) . toBe ( 201 ) ;
850-
851- const created = await response . json ( ) ;
852-
853- templateStorageHelper . addAdHocTemplateKey ( {
854- id : created . template . id ,
855- owner : userNoClient . userId ,
856- clientOwned : userNoClient . clientOwner ,
857- } ) ;
858-
859- expect ( created ) . toEqual ( {
860- statusCode : 201 ,
861- template : {
862- createdAt : expect . stringMatching ( isoDateRegExp ) ,
863- id : expect . stringMatching ( uuidRegExp ) ,
864- message : template . message ,
865- name : template . name ,
866- templateStatus : 'NOT_YET_SUBMITTED' ,
867- templateType : template . templateType ,
868- updatedAt : expect . stringMatching ( isoDateRegExp ) ,
869- } ,
870- } ) ;
871-
872- expect ( created . template . createdAt ) . toBeDateRoughlyBetween ( [
873- start ,
874- new Date ( ) ,
875- ] ) ;
876- expect ( created . template . createdAt ) . toEqual ( created . template . updatedAt ) ;
877- } ) ;
878-
879828 test ( 'can create a user-owned template' , async ( { request } ) => {
880829 const template = TemplateAPIPayloadFactory . getCreateTemplatePayload ( {
881830 templateType : 'NHS_APP' ,
0 commit comments