1- const TIMEOUT_MS = 20000 ;
1+ const TIMEOUT_MS = 40000 ;
22
33describe ( "Embedding SDK: metabase-nodejs-react-sdk-embedding-sample compatibility" , ( ) => {
44 it ( "should open an Interactive Question" , ( ) => {
@@ -12,4 +12,69 @@ describe("Embedding SDK: metabase-nodejs-react-sdk-embedding-sample compatibilit
1212
1313 expect ( cy . findByTestId ( "visualization-root" ) . should ( "exist" ) ) ;
1414 } ) ;
15+
16+ it ( "should download an Interactive Dashboard" , ( ) => {
17+ cy . visit ( {
18+ url : "/interactive-dashboard" ,
19+ } ) ;
20+
21+ expect ( cy . findByTestId ( "embed-frame" , { timeout : TIMEOUT_MS } ) . should ( "exist" ) ) ;
22+ cy . findByTestId ( "embed-frame" , { timeout : TIMEOUT_MS } ) . within ( ( ) => {
23+ cy . findByTestId ( "fixed-width-dashboard-header" , { timeout : TIMEOUT_MS } ) . within ( ( ) => {
24+ // Different icons for 54 and 55
25+ cy . get ( 'button svg.Icon-download, button svg.Icon-document' ) . first ( ) . click ( { force : true } ) ;
26+ } ) ;
27+
28+ cy . readFile ( 'cypress/downloads/E-commerce Insights.pdf' , { timeout : TIMEOUT_MS } ) . should ( 'exist' ) ;
29+ } ) ;
30+ } ) ;
31+
32+ it ( "should load a metabase locale" , ( ) => {
33+ cy . visit ( {
34+ url : "/interactive-question?locale=es&questionId=1" ,
35+ } ) ;
36+
37+ expect ( cy . findByText ( 'Tabla' , { timeout : TIMEOUT_MS } ) . should ( "exist" ) ) ;
38+ } ) ;
39+
40+ it ( "should load a moment locale" , ( ) => {
41+ const time = new Date ( '2025-01-01' )
42+ cy . clock ( time , [ 'Date' ] )
43+
44+ cy . visit ( {
45+ url : "/interactive-question?locale=es&questionId=1" ,
46+ } ) ;
47+
48+ cy . findByText ( 'Filtro' , { timeout : TIMEOUT_MS } ) . click ( ) ;
49+ cy . get ( '[data-element-id="mantine-popover"]' ) . within ( ( ) => {
50+ cy . findByText ( 'Created At' ) . click ( ) ;
51+ // Different texts for 54 and 55
52+ cy . findByText ( / ( F e c h a s r e l a t i v a s … | R a n g o d e f e c h a s r e l a t i v o … ) / ) . click ( ) ;
53+ } )
54+
55+ cy . findByTestId ( 'date-filter-picker' ) . within ( ( ) => {
56+
57+ cy . findByText ( 'dic. 2–31, 2024' ) . should ( 'exist' ) ;
58+ } )
59+ } ) ;
60+
61+ it ( "should load a dayjs locale" , ( ) => {
62+ const time = new Date ( '2025-01-01' )
63+ cy . clock ( time , [ 'Date' ] )
64+
65+ cy . visit ( {
66+ url : "/interactive-question?locale=es&questionId=1" ,
67+ } ) ;
68+
69+ cy . findByText ( 'Filtro' , { timeout : TIMEOUT_MS } ) . click ( ) ;
70+ cy . get ( '[data-element-id="mantine-popover"]' ) . within ( ( ) => {
71+ cy . findByText ( 'Created At' ) . click ( ) ;
72+ // Different texts for 54 and 55
73+ cy . findByText ( / ( F e c h a s e s p e c í f i c a s … | R a n g o d e f e c h a s f i j o … ) / ) . click ( ) ;
74+ } )
75+
76+ cy . findByTestId ( 'date-filter-picker' ) . within ( ( ) => {
77+ cy . findByText ( 'enero 2025' ) . should ( 'exist' ) ;
78+ } )
79+ } ) ;
1580} ) ;
0 commit comments