File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
test/suite/views/webview-app Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
const FEATURE_FLAGS = {
2
- useNewConnectionForm : `${ process . env . MDB_USE_NEW_CONNECTION_FORM } ` === 'true' ,
2
+ useOldConnectionForm : `${ process . env . MDB_USE_OLD_CONNECTION_FORM } ` === 'true' ,
3
3
} ;
4
4
5
5
export type FeatureFlag = keyof typeof FEATURE_FLAGS ;
Original file line number Diff line number Diff line change @@ -7,15 +7,15 @@ import App from '../../../../views/webview-app/app';
7
7
8
8
describe ( 'App Component Test Suite' , ( ) => {
9
9
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' , ( ) => {
11
11
sinon . stub ( featureFlags , 'getFeatureFlag' ) . returns ( false ) ;
12
12
render ( < App /> ) ;
13
- expect ( ( ) => screen . getAllByTestId ( 'legacy-app' ) ) . does . not . throw ;
13
+ expect ( screen . queryByTestId ( 'legacy-app' ) ) . to . be . null ;
14
14
} ) ;
15
15
16
- test ( 'it renders the new overview page when useNewConnectionForm is truthy' , ( ) => {
16
+ test ( 'it renders the new overview page when useOldConnectionForm is truthy' , ( ) => {
17
17
sinon . stub ( featureFlags , 'getFeatureFlag' ) . returns ( true ) ;
18
18
render ( < App /> ) ;
19
- expect ( screen . queryByTestId ( 'legacy-app' ) ) . to . be . null ;
19
+ expect ( ( ) => screen . getAllByTestId ( 'legacy-app' ) ) . does . not . throw ;
20
20
} ) ;
21
21
} ) ;
Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ import { useDetectVsCodeDarkMode } from './use-detect-vscode-dark-mode';
8
8
const App : React . FC = ( ) => {
9
9
const darkMode = useDetectVsCodeDarkMode ( ) ;
10
10
11
- return getFeatureFlag ( 'useNewConnectionForm' ) ? (
11
+ return getFeatureFlag ( 'useOldConnectionForm' ) ? (
12
+ < LegacyApp />
13
+ ) : (
12
14
< LeafyGreenProvider darkMode = { darkMode } >
13
15
< OverviewPage />
14
16
</ LeafyGreenProvider >
15
- ) : (
16
- < LegacyApp />
17
17
) ;
18
18
} ;
19
19
You can’t perform that action at this time.
0 commit comments