Skip to content

Commit

Permalink
feat(lint): linting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrusoare authored and geido committed Dec 13, 2024
1 parent 4b0689b commit af825d4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('SavedQuery', () => {
name: /save query/i,
});

expect(saveQueryModalHeader).toBeVisible();
expect(saveQueryModalHeader).toBeInTheDocument();
});

it('renders the save query modal UI', () => {
Expand All @@ -129,17 +129,17 @@ describe('SavedQuery', () => {
const saveBtns = screen.getAllByRole('button', { name: /save/i });
const cancelBtn = screen.getByRole('button', { name: /cancel/i });

expect(closeBtn).toBeVisible();
expect(saveQueryModalHeader).toBeVisible();
expect(nameLabel).toBeVisible();
expect(descriptionLabel).toBeVisible();
expect(closeBtn).toBeInTheDocument();
expect(saveQueryModalHeader).toBeInTheDocument();
expect(nameLabel).toBeInTheDocument();
expect(descriptionLabel).toBeInTheDocument();
expect(textBoxes.length).toBe(2);
expect(nameTextbox).toBeVisible();
expect(descriptionTextbox).toBeVisible();
expect(nameTextbox).toBeInTheDocument();
expect(descriptionTextbox).toBeInTheDocument();
expect(saveBtns.length).toBe(2);
expect(saveBtns[0]).toBeVisible();
expect(saveBtns[1]).toBeVisible();
expect(cancelBtn).toBeVisible();
expect(saveBtns[0]).toBeInTheDocument();
expect(saveBtns[1]).toBeInTheDocument();
expect(cancelBtn).toBeInTheDocument();
});

it('renders a "save as new" and "update" button if query already exists', () => {
Expand All @@ -163,8 +163,8 @@ describe('SavedQuery', () => {
const saveAsNewBtn = screen.getByRole('button', { name: /save as new/i });
const updateBtn = screen.getByRole('button', { name: /update/i });

expect(saveAsNewBtn).toBeVisible();
expect(updateBtn).toBeVisible();
expect(saveAsNewBtn).toBeInTheDocument();
expect(updateBtn).toBeInTheDocument();
});

it('renders a split save button when allows_virtual_table_explore is enabled', async () => {
Expand All @@ -188,17 +188,15 @@ describe('SavedQuery', () => {
store: mockStore(mockState),
});

await waitFor(() => {
const caretBtn = screen.getByRole('button', { name: /caret-down/i });
userEvent.click(caretBtn);
const caretBtn = await screen.findByRole('button', { name: /caret-down/i });
userEvent.click(caretBtn);

const saveDatasetMenuItem = screen.getByText(/save dataset/i);
userEvent.click(saveDatasetMenuItem);
});
const saveDatasetMenuItem = await screen.findByText(/save dataset/i);
userEvent.click(saveDatasetMenuItem);

const saveDatasetHeader = screen.getByText(/save or overwrite dataset/i);

expect(saveDatasetHeader).toBeVisible();
expect(saveDatasetHeader).toBeInTheDocument();
});

it('renders the save dataset modal UI', async () => {
Expand All @@ -207,13 +205,11 @@ describe('SavedQuery', () => {
store: mockStore(mockState),
});

await waitFor(() => {
const caretBtn = screen.getByRole('button', { name: /caret-down/i });
userEvent.click(caretBtn);
const caretBtn = await screen.findByRole('button', { name: /caret-down/i });
userEvent.click(caretBtn);

const saveDatasetMenuItem = screen.getByText(/save dataset/i);
userEvent.click(saveDatasetMenuItem);
});
const saveDatasetMenuItem = await screen.findByText(/save dataset/i);
userEvent.click(saveDatasetMenuItem);

const closeBtn = screen.getByRole('button', { name: /close/i });
const saveDatasetHeader = screen.getByText(/save or overwrite dataset/i);
Expand All @@ -231,14 +227,14 @@ describe('SavedQuery', () => {
/select or type dataset name/i,
);

expect(saveDatasetHeader).toBeVisible();
expect(closeBtn).toBeVisible();
expect(saveRadio).toBeVisible();
expect(saveLabel).toBeVisible();
expect(saveTextbox).toBeVisible();
expect(overwriteRadio).toBeVisible();
expect(overwriteLabel).toBeVisible();
expect(overwriteCombobox).toBeVisible();
expect(overwritePlaceholderText).toBeVisible();
expect(saveDatasetHeader).toBeInTheDocument();
expect(closeBtn).toBeInTheDocument();
expect(saveRadio).toBeInTheDocument();
expect(saveLabel).toBeInTheDocument();
expect(saveTextbox).toBeInTheDocument();
expect(overwriteRadio).toBeInTheDocument();
expect(overwriteLabel).toBeInTheDocument();
expect(overwriteCombobox).toBeInTheDocument();
expect(overwritePlaceholderText).toBeInTheDocument();
});
});
1 change: 0 additions & 1 deletion superset-frontend/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ export const StyledModal = styled(BaseModal)<StyledModalProps>`
.antd5-modal-close-x {
display: flex;
align-items: center;
justify-content: start;
.close {
flex: 1 1 auto;
Expand Down

0 comments on commit af825d4

Please sign in to comment.