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
50c35300
Unverified
Commit
50c35300
authored
3 years ago
by
Nemanja Glumac
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
#18729 Repro: XLSX export of "X of Y" (eg. Month of Year) is formatted as date column (#18792)
parent
8947f42a
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/test/metabase/scenarios/downloads/reproductions/18729-date-formatting-x-of-y.cy.spec.js
+61
-0
61 additions, 0 deletions
...ads/reproductions/18729-date-formatting-x-of-y.cy.spec.js
with
61 additions
and
0 deletions
frontend/test/metabase/scenarios/downloads/reproductions/18729-date-formatting-x-of-y.cy.spec.js
0 → 100644
+
61
−
0
View file @
50c35300
import
{
restore
,
downloadAndAssert
,
visitQuestionAdhoc
,
}
from
"
__support__/e2e/cypress
"
;
import
{
SAMPLE_DATASET
}
from
"
__support__/e2e/cypress_sample_dataset
"
;
const
{
ORDERS
,
ORDERS_ID
,
PRODUCTS
}
=
SAMPLE_DATASET
;
const
questionDetails
=
{
dataset_query
:
{
database
:
1
,
query
:
{
"
source-table
"
:
ORDERS_ID
,
aggregation
:
[[
"
count
"
]],
breakout
:
[
[
"
field
"
,
ORDERS
.
CREATED_AT
,
{
"
temporal-unit
"
:
"
month-of-year
"
}],
[
"
field
"
,
PRODUCTS
.
CATEGORY
,
{
"
source-field
"
:
ORDERS
.
PRODUCT_ID
}],
],
limit
:
2
,
},
type
:
"
query
"
,
},
display
:
"
line
"
,
};
describe
(
"
issue 18729
"
,
()
=>
{
beforeEach
(()
=>
{
cy
.
intercept
(
"
POST
"
,
"
/api/dataset
"
).
as
(
"
dataset
"
);
restore
();
cy
.
signInAsAdmin
();
});
[
"
csv
"
,
"
xlsx
"
].
forEach
(
fileType
=>
{
it
(
`should properly format the 'X of Y'dates in
${
fileType
}
exports (metabase#18729)`
,
()
=>
{
// TODO: Remove this line once the issue gets resolved
cy
.
skipOn
(
fileType
===
"
xlsx
"
);
visitQuestionAdhoc
(
questionDetails
);
cy
.
wait
(
"
@dataset
"
);
downloadAndAssert
({
fileType
},
assertion
);
});
});
});
function
assertion
(
sheet
)
{
// It currently says only "Created At", but that is already covered in an issue #18219.
// TODO: When 18219 gets fixed, uncomment the following assertion and delete the `contain` one.
// expect(sheet["A1"].v).to.eq("Created At: Month of year");
expect
(
sheet
[
"
A1
"
].
v
).
to
.
contain
(
"
Created At
"
);
// Based on how this issue gets resolved, the following assertions might need to change!
expect
(
sheet
[
"
A2
"
].
v
).
to
.
eq
(
1
);
expect
(
sheet
[
"
A2
"
].
t
).
to
.
eq
(
"
n
"
);
// Parsed values are always in the form of a string
expect
(
sheet
[
"
A2
"
].
w
).
to
.
eq
(
"
1
"
);
}
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