Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
072c0f39
Unverified
Commit
072c0f39
authored
1 year ago
by
Aleksandr Lesnenko
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix native editor flakes (#30087)
parent
fb4868b5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
e2e/test/scenarios/native/native.cy.spec.js
+12
-6
12 additions, 6 deletions
e2e/test/scenarios/native/native.cy.spec.js
frontend/src/metabase/query_builder/components/NativeQueryEditor.jsx
+4
-1
4 additions, 1 deletion
...c/metabase/query_builder/components/NativeQueryEditor.jsx
with
16 additions
and
7 deletions
e2e/test/scenarios/native/native.cy.spec.js
+
12
−
6
View file @
072c0f39
...
...
@@ -296,9 +296,9 @@ describe("scenarios > question > native", () => {
).
as
(
"
databasePrompt
"
);
openNativeEditor
();
cy
.
findByLabelText
(
"
Ask a question
"
).
click
();
ensureDatabasePickerIsHidden
();
cy
.
wait
(
100
);
cy
.
findByLabelText
(
"
Ask a question
"
).
click
(
);
cy
.
findByPlaceholderText
(
"
Ask anything...
"
)
.
focus
()
...
...
@@ -322,10 +322,9 @@ describe("scenarios > question > native", () => {
}).
as
(
"
databasePrompt
"
);
openNativeEditor
();
cy
.
findByLabelText
(
"
Ask a question
"
).
click
();
ensureDatabasePickerIsHidden
();
// When the native query editor is being initialized it acquires focus
cy
.
wait
(
100
);
cy
.
findByLabelText
(
"
Ask a question
"
).
click
();
cy
.
findByPlaceholderText
(
"
Ask anything...
"
)
.
focus
()
...
...
@@ -343,6 +342,7 @@ describe("scenarios > question > native", () => {
).
as
(
"
databasePrompt
"
);
cy
.
findByDisplayValue
(
PROMPT
).
type
(
"
fixed{enter}
"
);
cy
.
wait
(
"
@databasePrompt
"
);
runQuery
();
cy
.
findByText
(
"
18,760
"
);
...
...
@@ -351,6 +351,12 @@ describe("scenarios > question > native", () => {
});
const
runQuery
=
()
=>
{
cy
.
get
(
"
.NativeQueryEditor .Icon-play
"
).
click
();
cy
.
findByTestId
(
"
native-query-editor-container
"
).
within
(()
=>
{
cy
.
button
(
"
Get Answer
"
).
click
();
});
cy
.
wait
(
"
@dataset
"
);
};
function
ensureDatabasePickerIsHidden
()
{
cy
.
get
(
"
#DatabasePicker
"
).
should
(
"
not.exist
"
);
}
This diff is collapsed.
Click to expand it.
frontend/src/metabase/query_builder/components/NativeQueryEditor.jsx
+
4
−
1
View file @
072c0f39
...
...
@@ -577,7 +577,10 @@ class NativeQueryEditor extends Component {
);
return
(
<
NativeQueryEditorRoot
className
=
"NativeQueryEditor bg-light full"
>
<
NativeQueryEditorRoot
className
=
"NativeQueryEditor bg-light full"
data-testid
=
"native-query-editor-container"
>
{
hasTopBar
&&
(
<
div
className
=
"flex align-center"
data-testid
=
"native-query-top-bar"
>
{
canChangeDatabase
&&
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment