Explore: minor copy changes (#47922)

* Explore: minor copy changes

* fix tests
pull/47953/head
Giordano Ricci 3 years ago committed by GitHub
parent ff60f39e96
commit c1490a464a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      public/app/features/explore/AddToDashboard/AddToDashboardModal.tsx
  2. 8
      public/app/features/explore/AddToDashboard/index.test.tsx

@ -18,11 +18,11 @@ enum SaveTarget {
const SAVE_TARGETS: Array<SelectableValue<SaveTarget>> = [
{
label: 'New Dashboard',
label: 'New dashboard',
value: SaveTarget.NewDashboard,
},
{
label: 'Existing Dashboard',
label: 'Existing dashboard',
value: SaveTarget.ExistingDashboard,
},
];
@ -141,7 +141,7 @@ export const AddToDashboardModal = ({ onClose, exploreId }: Props) => {
<InputControl
control={control}
render={({ field: { ref, ...field } }) => (
<Field label="Target dashboard" description="Start a new dashboard or save the panel in an existing one.">
<Field label="Target dashboard" description="Choose where to add the panel.">
<RadioButtonGroup options={SAVE_TARGETS} {...field} id="e2d-save-target" />
</Field>
)}
@ -195,7 +195,7 @@ export const AddToDashboardModal = ({ onClose, exploreId }: Props) => {
Open in new tab
</Button>
<Button type="submit" variant="primary" onClick={handleSubmit(partial(onSubmit, false))} icon="apps">
Open
Open dashboard
</Button>
</Modal.ButtonRow>
</form>

@ -86,7 +86,7 @@ describe('AddToDashboardButton', () => {
await openModal();
userEvent.click(screen.getByRole('button', { name: /open$/i }));
userEvent.click(screen.getByRole('button', { name: /open dashboard$/i }));
await waitForAddToDashboardResponse();
@ -138,7 +138,7 @@ describe('AddToDashboardButton', () => {
await openModal();
userEvent.click(screen.getByRole('button', { name: /open$/i }));
userEvent.click(screen.getByRole('button', { name: /open dashboard$/i }));
await waitForAddToDashboardResponse();
@ -170,7 +170,7 @@ describe('AddToDashboardButton', () => {
userEvent.click(screen.getByRole<HTMLInputElement>('radio', { name: /existing dashboard/i }));
userEvent.click(screen.getByRole('button', { name: /open$/i }));
userEvent.click(screen.getByRole('button', { name: /open dashboard$/i }));
await waitForAddToDashboardResponse();
expect(locationService.push).not.toHaveBeenCalled();
@ -255,7 +255,7 @@ describe('AddToDashboardButton', () => {
});
userEvent.click(screen.getByLabelText('Select option'));
userEvent.click(screen.getByRole('button', { name: /open$/i }));
userEvent.click(screen.getByRole('button', { name: /open dashboard$/i }));
await waitFor(async () => {
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();

Loading…
Cancel
Save