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
b64e2b2a
Unverified
Commit
b64e2b2a
authored
4 years ago
by
Nemanja Glumac
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
#14294 Repro: Native questions don't respect Start of the week [ci skip] (#14330)
* Run each test in isolation * Add repro for #14294
parent
6c52efb9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/test/metabase/scenarios/admin/settings/localization.cy.spec.js
+48
-1
48 additions, 1 deletion
...metabase/scenarios/admin/settings/localization.cy.spec.js
with
48 additions
and
1 deletion
frontend/test/metabase/scenarios/admin/settings/localization.cy.spec.js
+
48
−
1
View file @
b64e2b2a
...
...
@@ -4,8 +4,8 @@ import { SAMPLE_DATASET } from "__support__/cypress_sample_dataset";
const
{
ORDERS
,
ORDERS_ID
}
=
SAMPLE_DATASET
;
describe
(
"
scenarios > admin > permissions
"
,
()
=>
{
before
(
restore
);
beforeEach
(()
=>
{
restore
();
signInAsAdmin
();
setFirstWeekDayTo
(
"
monday
"
);
});
...
...
@@ -81,6 +81,53 @@ describe("scenarios > admin > permissions", () => {
cy
.
get
(
"
.axis.x
"
).
contains
(
/monday/i
);
cy
.
get
(
"
.axis.x
"
).
contains
(
/tuesday/i
);
});
// HANDLE WITH CARE!
// This test is extremely tricky and fragile because it needs to test for the "past X weeks" to check if week starts on Sunday or Monday.
// As the time goes by we're risking that past X weeks don't yield any result when applied to the sample dataset.
// For that reason I've chosen the past 220 weeks (mid-October 2016). This should give us 3+ years to run this test without updates.
// TODO:
// - Keep an eye on this test in CI and update the week range as needed.
it
.
skip
(
"
should respect start of the week in SQL questions with filters (metabase#14294)
"
,
()
=>
{
cy
.
request
(
"
POST
"
,
"
/api/card
"
,
{
name
:
"
14294
"
,
dataset_query
:
{
database
:
1
,
native
:
{
"
template-tags
"
:
{
date_range
:
{
id
:
"
93961154-c3d5-7c93-7b59-f4e494fda499
"
,
name
:
"
date_range
"
,
"
display-name
"
:
"
Date range
"
,
type
:
"
dimension
"
,
dimension
:
[
"
field-id
"
,
ORDERS
.
CREATED_AT
],
"
widget-type
"
:
"
date/all-options
"
,
default
:
"
past220weeks
"
,
required
:
true
,
},
},
query
:
"
select ID, CREATED_AT, dayname(CREATED_AT) as CREATED_AT_DAY
\n
from ORDERS
\n
[[where {{date_range}}]]
\n
order by CREATED_AT
"
,
},
type
:
"
native
"
,
},
display
:
"
table
"
,
visualization_settings
:
{},
}).
then
(({
body
:
{
id
:
QUESTION_ID
}
})
=>
{
cy
.
visit
(
`/question/
${
QUESTION_ID
}
`
);
cy
.
get
(
"
.TableInteractive-header
"
)
.
next
()
.
as
(
"
resultTable
"
);
cy
.
get
(
"
@resultTable
"
).
within
(()
=>
{
// The third cell in the first row (CREATED_AT_DAY)
cy
.
get
(
"
.cellData
"
)
.
eq
(
2
)
.
should
(
"
not.contain
"
,
"
Sunday
"
);
});
});
});
});
function
setFirstWeekDayTo
(
day
)
{
...
...
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