Skip to content

Commit

Permalink
solve conflicts, update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Qxisylolo <[email protected]>
  • Loading branch information
Qxisylolo committed Nov 11, 2024
1 parent fcf568f commit f52af39
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 95 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,12 @@ describe('WorkspaceList', () => {
expect(checkboxes.length).toBeGreaterThanOrEqual(2);
fireEvent.click(checkboxes[0]);
expect(getByText('Delete 1 workspace')).toBeInTheDocument();
const deleteButton = getByTestId('workspace-list-page-delete-button');
const deleteButton = getByTestId('multi-deletion-button');
fireEvent.click(deleteButton);
expect(screen.queryByLabelText('mock delete workspace modal')).toBeInTheDocument();
const modalCancelButton = screen.getByLabelText('mock delete workspace modal button');
fireEvent.click(modalCancelButton);
expect(screen.queryByLabelText('mock delete workspace modal')).not.toBeInTheDocument();
});

it('should display "Delete 2 workspaces" and show modal when two workspaces are selected for deletion', async () => {
Expand All @@ -320,9 +323,12 @@ describe('WorkspaceList', () => {
fireEvent.click(checkboxes[0]);
fireEvent.click(checkboxes[1]);
expect(getByText('Delete 2 workspaces')).toBeInTheDocument();
const deleteButton = getByTestId('workspace-list-page-delete-button');
const deleteButton = getByTestId('multi-deletion-button');
fireEvent.click(deleteButton);
expect(screen.queryByLabelText('mock delete workspace modal')).toBeInTheDocument();
const modalCancelButton = screen.getByLabelText('mock delete workspace modal button');
fireEvent.click(modalCancelButton);
expect(screen.queryByLabelText('mock delete workspace modal')).not.toBeInTheDocument();
});

it('should render data source badge when more than two data sources', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,10 @@ export const WorkspaceListInner = ({
data-test-subj="multi-deletion-button"
>
{i18n.translate('workspace.list.page.delete.button.info', {
defaultMessage: 'Delete {num} workspace{pluralSuffix, select, true {} other {s}}',
defaultMessage:
'{selectedCount, plural, one {Delete # workspace} other {Delete # workspaces}}',
values: {
num: selection.length,
pluralSuffix: selection.length === 1,
selectedCount: selection.length,
},
})}
</EuiButton>
Expand Down

0 comments on commit f52af39

Please sign in to comment.