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
ef9fb057
Unverified
Commit
ef9fb057
authored
1 year ago
by
Kamil Mielnik
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Repro #35711 - Models broken with custom fields (#39763)
* Add repro for metabase#35711 * Format code
parent
af200d4d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
e2e/test/scenarios/models/reproductions/35711-metadata-in-models-with-custom-fields.cy.spec.ts
+71
-0
71 additions, 0 deletions
...ns/35711-metadata-in-models-with-custom-fields.cy.spec.ts
with
71 additions
and
0 deletions
e2e/test/scenarios/models/reproductions/35711-metadata-in-models-with-custom-fields.cy.spec.ts
0 → 100644
+
71
−
0
View file @
ef9fb057
import
{
SAMPLE_DATABASE
}
from
"
e2e/support/cypress_sample_database
"
;
import
{
openQuestionActions
,
popover
,
restore
}
from
"
e2e/support/helpers
"
;
import
type
{
FieldReference
}
from
"
metabase-types/api
"
;
const
{
ORDERS_ID
,
ORDERS
}
=
SAMPLE_DATABASE
;
const
DISCOUNT_FIELD_REF
:
FieldReference
=
[
"
field
"
,
ORDERS
.
DISCOUNT
,
{
"
base-type
"
:
"
type/Float
"
,
},
];
describe
(
"
issue 35711
"
,
()
=>
{
beforeEach
(()
=>
{
restore
();
cy
.
signInAsAdmin
();
});
it
(
"
can edit metadata of a model with a custom column (metabase#35711)
"
,
()
=>
{
cy
.
createQuestion
(
{
type
:
"
model
"
,
query
:
{
"
source-table
"
:
ORDERS_ID
,
expressions
:
{
"
Custom column
"
:
[
"
-
"
,
DISCOUNT_FIELD_REF
,
1
],
},
limit
:
5
,
// optimization
},
},
{
visitQuestion
:
true
},
);
openQuestionActions
();
popover
().
findByText
(
"
Edit metadata
"
).
click
();
reorderTaxAndTotalColumns
();
assertNoError
();
cy
.
findByTestId
(
"
editor-tabs-query-name
"
).
click
();
assertNoError
();
});
});
function
reorderTaxAndTotalColumns
()
{
cy
.
findAllByTestId
(
"
header-cell
"
).
eq
(
4
).
should
(
"
have.text
"
,
"
Tax
"
);
cy
.
findAllByTestId
(
"
header-cell
"
).
eq
(
5
).
should
(
"
have.text
"
,
"
Total
"
);
// drag & drop the Total column 100 px to the left to switch it with Tax column
cy
.
findAllByTestId
(
"
header-cell
"
)
.
contains
(
"
Total
"
)
.
then
(
totalColumn
=>
{
const
rect
=
totalColumn
[
0
].
getBoundingClientRect
();
cy
.
wrap
(
totalColumn
)
.
trigger
(
"
mousedown
"
)
.
trigger
(
"
mousemove
"
,
{
clientX
:
rect
.
x
-
100
,
clientY
:
rect
.
y
})
.
trigger
(
"
mouseup
"
);
});
cy
.
findAllByTestId
(
"
header-cell
"
).
eq
(
4
).
should
(
"
have.text
"
,
"
Total
"
);
cy
.
findAllByTestId
(
"
header-cell
"
).
eq
(
5
).
should
(
"
have.text
"
,
"
Tax
"
);
}
function
assertNoError
()
{
cy
.
button
(
"
Get Answer
"
).
should
(
"
not.exist
"
);
cy
.
get
(
"
main
"
)
.
findByText
(
"
There was a problem with your question
"
)
.
should
(
"
not.exist
"
);
cy
.
get
(
"
.cellData
"
).
should
(
"
contain
"
,
"
37.65
"
);
}
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