kubernetesDashboards: Fix dashboard export e2e test failing with v1 k8s API enabled (#107900)

Fix dashboard export e2e
pull/107982/head
Dominik Prokop 1 week ago committed by GitHub
parent 84ef5bc744
commit 190b9e1b06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      public/app/features/dashboard-scene/sharing/ExportButton/ResourceExport.tsx

@ -1,5 +1,6 @@
import { AsyncState } from 'react-use/lib/useAsync';
import { selectors as e2eSelectors } from '@grafana/e2e-selectors';
import { Trans, t } from '@grafana/i18n';
import { Dashboard } from '@grafana/schema/dist/esm/index.gen';
import { Spec as DashboardV2Spec } from '@grafana/schema/dist/esm/schema/dashboard/v2alpha1/types.spec.gen';
@ -28,6 +29,8 @@ interface Props {
onViewYAML: () => void;
}
const selector = e2eSelectors.pages.ExportDashboardDrawer.ExportAsJson;
export function ResourceExport({
dashboardJson,
isSharingExternally,
@ -110,7 +113,12 @@ export function ResourceExport({
(initialSaveModelVersion === 'v2' && exportMode === ExportMode.V1Resource)) && (
<Stack gap={1} alignItems="start">
<Label>{switchExportLabel}</Label>
<Switch label={switchExportLabel} value={isSharingExternally} onChange={onShareExternallyChange} />
<Switch
label={switchExportLabel}
value={isSharingExternally}
onChange={onShareExternallyChange}
data-testid={selector.exportExternallyToggle}
/>
</Stack>
)}
</Stack>

Loading…
Cancel
Save