|
|
|
@ -96,10 +96,28 @@ describe('SharePublic', () => { |
|
|
|
|
await screen.findByText('Welcome to Grafana public dashboards alpha!'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// test when checkboxes show up
|
|
|
|
|
// test checkboxes hidden
|
|
|
|
|
// test url hidden
|
|
|
|
|
// test url shows up
|
|
|
|
|
//
|
|
|
|
|
it('renders default time in inputs', async () => { |
|
|
|
|
config.featureToggles.publicDashboards = true; |
|
|
|
|
const mockDashboard = new DashboardModel({ |
|
|
|
|
uid: 'mockDashboardUid', |
|
|
|
|
}); |
|
|
|
|
const mockPanel = new PanelModel({ |
|
|
|
|
id: 'mockPanelId', |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
expect(mockDashboard.time).toEqual({ from: 'now-6h', to: 'now' }); |
|
|
|
|
//@ts-ignore
|
|
|
|
|
mockDashboard.originalTime = { from: 'test-from', to: 'test-to' }; |
|
|
|
|
|
|
|
|
|
render(<ShareModal panel={mockPanel} dashboard={mockDashboard} onDismiss={() => {}} />); |
|
|
|
|
|
|
|
|
|
await waitFor(() => screen.getByText('Link')); |
|
|
|
|
fireEvent.click(screen.getByText('Public Dashboard')); |
|
|
|
|
|
|
|
|
|
await screen.findByText('Welcome to Grafana public dashboards alpha!'); |
|
|
|
|
expect(screen.getByDisplayValue('test-from')).toBeInTheDocument(); |
|
|
|
|
expect(screen.getByDisplayValue('test-to')).toBeInTheDocument(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// test checking if current version of dashboard in state is persisted to db
|
|
|
|
|
}); |
|
|
|
|