@@ -114,7 +114,7 @@ describe('Collection schema tab', function () {
114114 await browser . setFeature ( 'enableExportSchema' , true ) ;
115115 } ) ;
116116
117- it . only ( 'shows an exported schema to copy' , async function ( ) {
117+ it ( 'shows an exported schema to copy' , async function ( ) {
118118 await browser . navigateToCollectionTab (
119119 DEFAULT_CONNECTION_NAME_1 ,
120120 'test' ,
@@ -131,16 +131,27 @@ describe('Collection schema tab', function () {
131131 const exportModal = browser . $ ( Selectors . ExportSchemaFormatOptions ) ;
132132 await exportModal . waitForDisplayed ( ) ;
133133
134- // TODO: Check format and then change it.
135- // await browser.clickVisible(Selectors.AnalyzeSchemaButton);
136-
137134 const exportSchemaContent = browser . $ ( Selectors . ExportSchemaOutput ) ;
138135 await exportSchemaContent . waitForDisplayed ( ) ;
139- // expect(
140- // await browser.getCodemirrorEditorText(Selectors.ExportSchemaOutput)
141- // ).to.match(/{\s+\$set:\s+{\s+},?\s+}/);
142136 const text = await browser . $ ( Selectors . ExportSchemaOutput ) . getText ( ) ;
143- expect ( text ) . to . match ( 'test' ) ;
137+ const parsedText = JSON . parse ( text ) ;
138+ delete parsedText . $defs ;
139+ expect ( parsedText ) . to . deep . equal ( {
140+ $schema : 'https://json-schema.org/draft/2020-12/schema' ,
141+ type : 'object' ,
142+ required : [ '_id' , 'i' , 'j' ] ,
143+ properties : {
144+ _id : {
145+ $ref : '#/$defs/ObjectId' ,
146+ } ,
147+ i : {
148+ type : 'integer' ,
149+ } ,
150+ j : {
151+ type : 'integer' ,
152+ } ,
153+ } ,
154+ } ) ;
144155 } ) ;
145156 } ) ;
146157
0 commit comments