This repository was archived by the owner on Jan 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ export class MDCDrawer extends MDCComponent<MDCDismissibleDrawerFoundation> {
68
68
private handleKeydown_ ! : SpecificEventListener < 'keydown' > ; // initialized in initialSyncWithDOM()
69
69
private handleTransitionEnd_ ! : SpecificEventListener < 'transitionend' > ; // initialized in initialSyncWithDOM()
70
70
71
+ get list ( ) : MDCList | undefined {
72
+ return this . list_ ;
73
+ }
74
+
71
75
initialize (
72
76
focusTrapFactory : MDCDrawerFocusTrapFactory = createFocusTrap as unknown as MDCDrawerFocusTrapFactory ,
73
77
listFactory : MDCListFactory = ( el ) => new MDCList ( el ) ,
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import td from 'testdouble';
28
28
29
29
import { MDCDrawer } from '../../../packages/mdc-drawer/index' ;
30
30
import { strings , cssClasses } from '../../../packages/mdc-drawer/constants' ;
31
- import { MDCListFoundation } from '../../../packages/mdc-list/index' ;
31
+ import { MDCList , MDCListFoundation } from '../../../packages/mdc-list/index' ;
32
32
import { MDCDismissibleDrawerFoundation } from '../../../packages/mdc-drawer/dismissible/foundation' ;
33
33
import { MDCModalDrawerFoundation } from '../../../packages/mdc-drawer/modal/foundation' ;
34
34
@@ -150,6 +150,11 @@ test('#set open false calls foundation.close', () => {
150
150
td . verify ( mockFoundation . close ( ) , { times : 1 } ) ;
151
151
} ) ;
152
152
153
+ test ( '#get list returns MDCList instance when DOM includes list' , ( ) => {
154
+ const { component} = setupTest ( ) ;
155
+ assert . instanceOf ( component . list , MDCList ) ;
156
+ } ) ;
157
+
153
158
test ( 'click event calls foundation.handleScrimClick method' , ( ) => {
154
159
const { root, mockFoundation} = setupTestWithMocks ( { variantClass : cssClasses . MODAL } ) ;
155
160
const scrimEl = root . querySelector ( '.mdc-drawer-scrim' ) ;
You can’t perform that action at this time.
0 commit comments