2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ describe('setDocument', () => {
84
84
85
85
await client . setDocument ( {
86
86
documentID : newDocument . documentID ,
87
- id : newDocument . id , // diagram ID
87
+ projectID : newDocument . projectID ,
88
88
title : "@mermaidchart/sdk E2E test diagram" ,
89
89
code,
90
90
} ) ;
@@ -98,15 +98,14 @@ describe('setDocument', () => {
98
98
} ) ;
99
99
} ) ;
100
100
101
- // TODO: this function never seems to return an error, see MC-1060
102
- it . skip ( 'should throw an error on invalid data' , async ( ) => {
101
+ it ( 'should throw an error on invalid data' , async ( ) => {
103
102
const newDocument = await client . createDocument ( testProjectId ) ;
104
103
documentsToDelete . add ( newDocument . documentID ) ;
105
104
106
105
await expect ( client . setDocument ( {
107
106
documentID : newDocument . documentID ,
108
- // @ts -expect-error not setting diagram `id ` should throw an error
109
- id : null ,
107
+ // @ts -expect-error not setting diagram `projectID ` should throw an error
108
+ projectID : null ,
110
109
} ) ) . rejects . toThrowError ( "400" ) ; // should throw HTTP 400 error
111
110
} ) ;
112
111
} ) ;
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ export class MermaidChart {
210
210
* @param document The document to update.
211
211
*/
212
212
public async setDocument (
213
- document : Pick < MCDocument , 'id ' | 'documentID ' > & Partial < MCDocument > ,
213
+ document : Pick < MCDocument , 'documentID ' | 'projectID ' > & Partial < MCDocument > ,
214
214
) {
215
215
const { data} = await this . axios . put < { result : "ok" } | { result : "failed" , error : any } > (
216
216
URLS . rest . documents . pick ( document ) . self ,
0 commit comments