Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 0 additions & 59 deletions e2e/test/compatibility.cy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,64 +68,5 @@ const TIMEOUT_MS = 40000;
cy.findByTestId("dashboard-grid").should("exist");
});
});

it("should download an Interactive Dashboard", () => {
cy.visit({
url: "/interactive-dashboard",
});

expect(cy.findByTestId("embed-frame", {timeout: TIMEOUT_MS}).should("exist"));
cy.findByTestId("embed-frame", {timeout: TIMEOUT_MS}).within(() => {
cy.findByTestId("fixed-width-dashboard-header").within(() => {
// Different icons for 54 and 55
cy.get('button svg.Icon-download, button svg.Icon-document').first().click();
});

cy.readFile('cypress/downloads/E-commerce Insights.pdf', {timeout: TIMEOUT_MS}).should('exist');
});
});

it("should load a metabase locale", () => {
cy.visit({
url: "/interactive-question?locale=es",
});

expect(cy.findByText('Tabla', {timeout: TIMEOUT_MS}).should("exist"));
});

it("should load a moment locale", () => {
const time = new Date('2025-01-01')
cy.clock(time, ['Date'])

cy.visit({
url: "/interactive-question?locale=es",
});

cy.findAllByTestId('cell-data').then((cells) => {
const texts = [...cells].map((el) => el.textContent);
expect(texts.join(' ')).to.include('febrero');
expect(texts.join(' ')).to.include('mayo');
});
});

it("should load a dayjs locale", () => {
const time = new Date('2025-01-01')
cy.clock(time, ['Date'])

cy.visit({
url: "/interactive-question?locale=es",
});

cy.findByText('Filtro', {timeout: TIMEOUT_MS}).click();
cy.get('[data-element-id="mantine-popover"]').within(() => {
cy.findByText('Created At').click();
// Different texts for 54 and 55
cy.findByText(/(Fechas específicas…|Rango de fechas fijo…)/).click();
})

cy.findByTestId('date-filter-picker').within(() => {
cy.findByText('enero 2025').should('exist');
})
});
});
});
23 changes: 8 additions & 15 deletions next-sample-app-router/src/app/app-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";

import { useSearchParams } from 'next/navigation'
import {
MetabaseProvider,
defineMetabaseAuthConfig,
Expand Down Expand Up @@ -58,17 +57,11 @@ const theme = defineMetabaseTheme({
},
});

export const AppProvider = ({children}: PropsWithChildren) => {
const searchParams = useSearchParams()
const locale = searchParams.get('locale') ?? undefined

return (
<MetabaseProvider
authConfig={authConfig}
theme={theme}
locale={locale}
>
{children}
</MetabaseProvider>
)
}
export const AppProvider = ({children}: PropsWithChildren) => (
<MetabaseProvider
authConfig={authConfig}
theme={theme}
>
{children}
</MetabaseProvider>
)
23 changes: 8 additions & 15 deletions next-sample-pages-router/src/components/app-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useSearchParams } from 'next/navigation'
import {
MetabaseProvider,
defineMetabaseAuthConfig,
Expand Down Expand Up @@ -56,17 +55,11 @@ const theme = defineMetabaseTheme({
},
});

export const AppProvider = ({children}: PropsWithChildren) => {
const searchParams = useSearchParams()
const locale = searchParams.get('locale') ?? undefined

return (
<MetabaseProvider
authConfig={authConfig}
theme={theme}
locale={locale}
>
{children}
</MetabaseProvider>
)
}
export const AppProvider = ({children}: PropsWithChildren) => (
<MetabaseProvider
authConfig={authConfig}
theme={theme}
>
{children}
</MetabaseProvider>
)