Submit
Path:
~
/
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
dashboard
/
components
/
RowOptions
/
File Content:
RowOptionsForm.test.tsx
import { render, screen } from '@testing-library/react'; import React from 'react'; import { TestProvider } from 'test/helpers/TestProvider'; import { selectors } from '@grafana/e2e-selectors'; import { RowOptionsForm } from './RowOptionsForm'; jest.mock('../RepeatRowSelect/RepeatRowSelect', () => ({ RepeatRowSelect: () => <div />, })); describe('DashboardRow', () => { it('Should show warning component when has warningMessage prop', () => { render( <TestProvider> <RowOptionsForm repeat={'3'} title="" onCancel={jest.fn()} onUpdate={jest.fn()} warning="a warning message" /> </TestProvider> ); expect( screen.getByTestId(selectors.pages.Dashboard.Rows.Repeated.ConfigSection.warningMessage) ).toBeInTheDocument(); }); it('Should not show warning component when does not have warningMessage prop', () => { render( <TestProvider> <RowOptionsForm repeat={'3'} title="" onCancel={jest.fn()} onUpdate={jest.fn()} /> </TestProvider> ); expect( screen.queryByTestId(selectors.pages.Dashboard.Rows.Repeated.ConfigSection.warningMessage) ).not.toBeInTheDocument(); }); });
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
RowOptionsButton.tsx
1220 bytes
0644
RowOptionsForm.test.tsx
1166 bytes
0644
RowOptionsForm.tsx
1794 bytes
0644
RowOptionsModal.tsx
848 bytes
0644
N4ST4R_ID | Naxtarrr