@@ -129,4 +129,57 @@ describe("Table", () => {
129129
130130 expect ( screen . getByRole ( "paragraph" ) ) . not . toBeInTheDocument ( ) ;
131131 } ) ;
132+
133+ it ( "should support fullscreen mode" , async ( ) => {
134+ const jsonDocument : DocumentJson = {
135+ tag : "table" ,
136+ attributes : { "@xml:id" : "t3" } ,
137+ value : [
138+ { tag : "head" , attributes : { "@type" : "label" } , value : "Table 3" } ,
139+ {
140+ tag : "row" ,
141+ attributes : { "@role" : "label" } ,
142+ value : [
143+ { tag : "cell" , attributes : { } , value : "H1" } ,
144+ { tag : "cell" , attributes : { } , value : "H2" } ,
145+ ] ,
146+ } ,
147+ {
148+ tag : "row" ,
149+ attributes : { "@role" : "data" } ,
150+ value : [
151+ { tag : "cell" , attributes : { } , value : "D1" } ,
152+ { tag : "cell" , attributes : { } , value : "D2" } ,
153+ ] ,
154+ } ,
155+ ] ,
156+ } ;
157+
158+ const screen = await render ( < Table data = { jsonDocument } /> , {
159+ wrapper : ( { children } ) => (
160+ < TagCatalogProvider tagCatalog = { tagCatalog } >
161+ { children }
162+ </ TagCatalogProvider >
163+ ) ,
164+ } ) ;
165+
166+ const fullScreenButton = screen . getByRole ( "button" , {
167+ name : "Passer en mode plein écran" ,
168+ } ) ;
169+ expect ( fullScreenButton ) . toBeVisible ( ) ;
170+
171+ await fullScreenButton . click ( ) ;
172+
173+ const dialog = screen . getByRole ( "dialog" ) ;
174+ expect ( dialog ) . toBeVisible ( ) ;
175+
176+ const exitFullScreenButton = screen . getByRole ( "button" , {
177+ name : "Quitter le mode plein écran" ,
178+ } ) ;
179+ expect ( exitFullScreenButton ) . toBeVisible ( ) ;
180+
181+ await exitFullScreenButton . click ( ) ;
182+
183+ expect ( dialog ) . not . toBeInTheDocument ( ) ;
184+ } ) ;
132185} ) ;
0 commit comments