Skip to content

Commit cab4305

Browse files
committed
feat(schema): enable export schema feature
1 parent 5ff535f commit cab4305

File tree

3 files changed

+37
-58
lines changed

3 files changed

+37
-58
lines changed

packages/compass-e2e-tests/tests/collection-schema-tab.test.ts

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -109,53 +109,45 @@ describe('Collection schema tab', function () {
109109
});
110110
}
111111

112-
describe('with the enableExportSchema feature flag enabled', function () {
113-
beforeEach(async function () {
114-
// TODO(COMPASS-8819): remove web skip when defaulted true.
115-
skipForWeb(this, "can't toggle features in compass-web");
116-
await browser.setFeature('enableExportSchema', true);
117-
});
118-
119-
it('shows an exported schema to copy', async function () {
120-
await browser.navigateToCollectionTab(
121-
DEFAULT_CONNECTION_NAME_1,
122-
'test',
123-
'numbers',
124-
'Schema'
125-
);
126-
await browser.clickVisible(Selectors.AnalyzeSchemaButton);
112+
it('shows an exported schema to copy', async function () {
113+
await browser.navigateToCollectionTab(
114+
DEFAULT_CONNECTION_NAME_1,
115+
'test',
116+
'numbers',
117+
'Schema'
118+
);
119+
await browser.clickVisible(Selectors.AnalyzeSchemaButton);
127120

128-
const element = browser.$(Selectors.SchemaFieldList);
129-
await element.waitForDisplayed();
121+
const element = browser.$(Selectors.SchemaFieldList);
122+
await element.waitForDisplayed();
130123

131-
await browser.clickVisible(Selectors.ExportSchemaButton);
124+
await browser.clickVisible(Selectors.ExportSchemaButton);
132125

133-
const exportModal = browser.$(Selectors.ExportSchemaFormatOptions);
134-
await exportModal.waitForDisplayed();
126+
const exportModal = browser.$(Selectors.ExportSchemaFormatOptions);
127+
await exportModal.waitForDisplayed();
135128

136-
const exportSchemaContent = browser.$(Selectors.ExportSchemaOutput);
137-
await exportSchemaContent.waitForDisplayed();
138-
const text = await browser.getCodemirrorEditorText(
139-
Selectors.ExportSchemaOutput
140-
);
141-
const parsedText = JSON.parse(text);
142-
delete parsedText.$defs;
143-
expect(parsedText).to.deep.equal({
144-
$schema: 'https://json-schema.org/draft/2020-12/schema',
145-
type: 'object',
146-
required: ['_id', 'i', 'j'],
147-
properties: {
148-
_id: {
149-
$ref: '#/$defs/ObjectId',
150-
},
151-
i: {
152-
type: 'integer',
153-
},
154-
j: {
155-
type: 'integer',
156-
},
129+
const exportSchemaContent = browser.$(Selectors.ExportSchemaOutput);
130+
await exportSchemaContent.waitForDisplayed();
131+
const text = await browser.getCodemirrorEditorText(
132+
Selectors.ExportSchemaOutput
133+
);
134+
const parsedText = JSON.parse(text);
135+
delete parsedText.$defs;
136+
expect(parsedText).to.deep.equal({
137+
$schema: 'https://json-schema.org/draft/2020-12/schema',
138+
type: 'object',
139+
required: ['_id', 'i', 'j'],
140+
properties: {
141+
_id: {
142+
$ref: '#/$defs/ObjectId',
143+
},
144+
i: {
145+
type: 'integer',
146+
},
147+
j: {
148+
type: 'integer',
157149
},
158-
});
150+
},
159151
});
160152
});
161153

packages/compass-preferences-model/src/feature-flags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const featureFlags: Required<{
106106
* Feature flag for export schema. Epic: COMPASS-6862.
107107
*/
108108
enableExportSchema: {
109-
stage: 'development',
109+
stage: 'released',
110110
description: {
111111
short: 'Enable schema export',
112112
},

packages/compass-schema/src/components/schema-toolbar/schema-toolbar.spec.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,7 @@ describe('SchemaToolbar', function () {
147147
expect(screen.queryByTestId(exportSchemaTestId)).to.not.exist;
148148
});
149149

150-
describe('when rendered with the enableExportSchema feature flag true', function () {
151-
beforeEach(function () {
152-
renderSchemaToolbar(
153-
{
154-
sampleSize: 100,
155-
},
156-
{
157-
enableExportSchema: true,
158-
}
159-
);
160-
});
161-
162-
it('renders the export schema button', function () {
163-
expect(screen.getByTestId(exportSchemaTestId)).to.be.visible;
164-
});
150+
it('renders the export schema button', function () {
151+
expect(screen.getByTestId(exportSchemaTestId)).to.be.visible;
165152
});
166153
});

0 commit comments

Comments
 (0)