Skip to content

Commit

Permalink
chore: rename 'Change dataset' action to 'Swap dataset' (#22197)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Nov 23, 2022
1 parent a77b2d6 commit 888f43c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
show={show}
onHide={onHide}
responsive
title={t('Change dataset')}
title={t('Swap dataset')}
width={confirmChange ? '432px' : ''}
height={confirmChange ? 'auto' : '540px'}
hideFooter={!confirmChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ test('Should open a menu', async () => {
render(<DatasourceControl {...props} />);

expect(screen.queryByText('Edit dataset')).not.toBeInTheDocument();
expect(screen.queryByText('Change dataset')).not.toBeInTheDocument();
expect(screen.queryByText('Swap dataset')).not.toBeInTheDocument();
expect(screen.queryByText('View in SQL Lab')).not.toBeInTheDocument();

userEvent.click(screen.getByTestId('datasource-menu-trigger'));

expect(await screen.findByText('Edit dataset')).toBeInTheDocument();
expect(screen.getByText('Change dataset')).toBeInTheDocument();
expect(screen.getByText('Swap dataset')).toBeInTheDocument();
expect(screen.getByText('View in SQL Lab')).toBeInTheDocument();
});

test('Click on Change dataset option', async () => {
test('Click on Swap dataset option', async () => {
const props = createProps();
SupersetClientGet.mockImplementation(
async ({ endpoint }: { endpoint: string }) => {
Expand All @@ -123,7 +123,7 @@ test('Click on Change dataset option', async () => {
userEvent.click(screen.getByTestId('datasource-menu-trigger'));

await act(async () => {
userEvent.click(screen.getByText('Change dataset'));
userEvent.click(screen.getByText('Swap dataset'));
});
expect(
screen.getByText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class DatasourceControl extends React.PureComponent {
)}
</Menu.Item>
)}
<Menu.Item key={CHANGE_DATASET}>{t('Change dataset')}</Menu.Item>
<Menu.Item key={CHANGE_DATASET}>{t('Swap dataset')}</Menu.Item>
{datasource && (
<Menu.Item key={VIEW_IN_SQL_LAB}>{t('View in SQL Lab')}</Menu.Item>
)}
Expand Down Expand Up @@ -421,7 +421,7 @@ class DatasourceControl extends React.PureComponent {
this.handleMenuItemClick({ key: CHANGE_DATASET })
}
>
{t('Change dataset')}
{t('Swap dataset')}
</Button>
</p>
</>
Expand Down

0 comments on commit 888f43c

Please sign in to comment.