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,53 @@ describe("Embedding SDK: metabase-nodejs-react-sdk-embedding-sample compatibilit
1212
1313 expect ( cy . findByTestId ( "visualization-root" ) . should ( "exist" ) ) ;
1414 } ) ;
15+
16+ it ( "should load a metabase locale" , ( ) => {
17+ cy . visit ( {
18+ url : "/?locale=es&questionId=1" ,
19+ } ) ;
20+
21+ expect ( cy . findByText ( 'Tabla' , { timeout : TIMEOUT_MS } ) . should ( "exist" ) ) ;
22+ } ) ;
23+
24+ it ( "should load a moment locale" , ( ) => {
25+ const time = new Date ( '2025-01-01' )
26+ cy . clock ( time , [ 'Date' ] )
27+
28+ cy . visit ( {
29+ url : "/?locale=es&questionId=1" ,
30+ } ) ;
31+
32+ cy . findByText ( 'Filtro' , { timeout : TIMEOUT_MS } ) . click ( ) ;
33+ cy . get ( '[data-element-id="mantine-popover"]' ) . within ( ( ) => {
34+ cy . findByText ( 'Created At' ) . click ( ) ;
35+ // Different texts for 54 and 55
36+ 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 ( ) ;
37+ } )
38+
39+ cy . findByTestId ( 'date-filter-picker' ) . within ( ( ) => {
40+
41+ cy . findByText ( 'dic. 2–31, 2024' ) . should ( 'exist' ) ;
42+ } )
43+ } ) ;
44+
45+ it ( "should load a dayjs locale" , ( ) => {
46+ const time = new Date ( '2025-01-01' )
47+ cy . clock ( time , [ 'Date' ] )
48+
49+ cy . visit ( {
50+ url : "/?locale=es&questionId=1" ,
51+ } ) ;
52+
53+ cy . findByText ( 'Filtro' , { timeout : TIMEOUT_MS } ) . click ( ) ;
54+ cy . get ( '[data-element-id="mantine-popover"]' ) . within ( ( ) => {
55+ cy . findByText ( 'Created At' ) . click ( ) ;
56+ // Different texts for 54 and 55
57+ 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 ( ) ;
58+ } )
59+
60+ cy . findByTestId ( 'date-filter-picker' ) . within ( ( ) => {
61+ cy . findByText ( 'enero 2025' ) . should ( 'exist' ) ;
62+ } )
63+ } ) ;
1564} ) ;
0 commit comments