File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ import { getSupportedElicitationModes } from './elicitation-utils.js';
22
33describe ( 'elicitation-utils' , ( ) => {
44 describe ( 'getSupportedElicitationModes' , ( ) => {
5- it ( 'should default to form mode when capabilities are undefined' , ( ) => {
5+ it ( 'should support nothing when capabilities are undefined' , ( ) => {
66 const result = getSupportedElicitationModes ( undefined ) ;
7- expect ( result . supportsFormMode ) . toBe ( true ) ;
7+ expect ( result . supportsFormMode ) . toBe ( false ) ;
88 expect ( result . supportsUrlMode ) . toBe ( false ) ;
99 } ) ;
1010
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ export function getSupportedElicitationModes(capabilities: ClientCapabilities['e
1818 supportsFormMode : boolean ;
1919 supportsUrlMode : boolean ;
2020} {
21+ if ( ! capabilities ) {
22+ return { supportsFormMode : false , supportsUrlMode : false } ;
23+ }
24+
2125 const hasFormCapability = Object . prototype . hasOwnProperty . call ( capabilities , 'form' ) ;
2226 const hasUrlCapability = Object . prototype . hasOwnProperty . call ( capabilities , 'url' ) ;
2327
You can’t perform that action at this time.
0 commit comments