Skip to content

Commit 4e2cbeb

Browse files
authored
feat(webview): update feature flag to always show new connection form VSCODE-490 (#637)
1 parent 28668ed commit 4e2cbeb

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/featureFlags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const FEATURE_FLAGS = {
2-
useNewConnectionForm: `${process.env.MDB_USE_NEW_CONNECTION_FORM}` === 'true',
2+
useOldConnectionForm: `${process.env.MDB_USE_OLD_CONNECTION_FORM}` === 'true',
33
};
44

55
export type FeatureFlag = keyof typeof FEATURE_FLAGS;

src/test/suite/views/webview-app/app.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import App from '../../../../views/webview-app/app';
77

88
describe('App Component Test Suite', () => {
99
afterEach(() => sinon.restore());
10-
test('it renders the old overview page when useNewConnectionForm is falsy', () => {
10+
test('it renders the old overview page when useOldConnectionForm is falsy', () => {
1111
sinon.stub(featureFlags, 'getFeatureFlag').returns(false);
1212
render(<App />);
13-
expect(() => screen.getAllByTestId('legacy-app')).does.not.throw;
13+
expect(screen.queryByTestId('legacy-app')).to.be.null;
1414
});
1515

16-
test('it renders the new overview page when useNewConnectionForm is truthy', () => {
16+
test('it renders the new overview page when useOldConnectionForm is truthy', () => {
1717
sinon.stub(featureFlags, 'getFeatureFlag').returns(true);
1818
render(<App />);
19-
expect(screen.queryByTestId('legacy-app')).to.be.null;
19+
expect(() => screen.getAllByTestId('legacy-app')).does.not.throw;
2020
});
2121
});

src/views/webview-app/app.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import { useDetectVsCodeDarkMode } from './use-detect-vscode-dark-mode';
88
const App: React.FC = () => {
99
const darkMode = useDetectVsCodeDarkMode();
1010

11-
return getFeatureFlag('useNewConnectionForm') ? (
11+
return getFeatureFlag('useOldConnectionForm') ? (
12+
<LegacyApp />
13+
) : (
1214
<LeafyGreenProvider darkMode={darkMode}>
1315
<OverviewPage />
1416
</LeafyGreenProvider>
15-
) : (
16-
<LegacyApp />
1717
);
1818
};
1919

0 commit comments

Comments
 (0)