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
bce9d9f4
Unverified
Commit
bce9d9f4
authored
1 year ago
by
shaun
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Add future e2e spec to improve Filter <> DatePicker compatibility (#32288)
parent
082215f7
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
e2e/test/scenarios/filters/reproductions/12496-drill-through-filter-date.cy.spec.js
+108
-0
108 additions, 0 deletions
.../reproductions/12496-drill-through-filter-date.cy.spec.js
with
108 additions
and
0 deletions
e2e/test/scenarios/filters/reproductions/12496-drill-through-filter-date.cy.spec.js
0 → 100644
+
108
−
0
View file @
bce9d9f4
import
{
popover
,
restore
}
from
"
e2e/support/helpers
"
;
import
{
SAMPLE_DATABASE
}
from
"
e2e/support/cypress_sample_database
"
;
const
{
ORDERS
,
ORDERS_ID
}
=
SAMPLE_DATABASE
;
describe
.
skip
(
"
issue 12496
"
,
()
=>
{
beforeEach
(()
=>
{
restore
();
cy
.
signInAsAdmin
();
});
const
datePickerInput
=
(
picker
,
input
)
=>
cy
.
findAllByTestId
(
"
specific-date-picker
"
)
.
eq
(
picker
)
.
find
(
"
input
"
)
.
eq
(
input
);
const
setup
=
unit
=>
{
cy
.
createQuestion
(
{
name
:
`Orders by Created At:
${
unit
}
`
,
query
:
{
"
source-table
"
:
ORDERS_ID
,
aggregation
:
[[
"
count
"
]],
breakout
:
[[
"
field
"
,
ORDERS
.
CREATED_AT
,
{
"
temporal-unit
"
:
unit
}]],
filter
:
[
"
between
"
,
[
"
field
"
,
ORDERS
.
CREATED_AT
,
null
],
"
2022-04-01
"
,
"
2022-05-31
"
,
],
},
display
:
"
line
"
,
},
{
visitQuestion
:
true
},
);
// When a filter is added above, we have to unhide the filter pills:
cy
.
findByTestId
(
"
filters-visibility-control
"
).
click
();
};
it
(
"
should display correct day range in filter pill when drilling into a week
"
,
()
=>
{
setup
(
"
week
"
);
cy
.
get
(
"
.dot
"
).
eq
(
0
).
click
({
force
:
true
});
popover
().
contains
(
"
See this Order
"
).
click
();
cy
.
findByTestId
(
"
qb-filters-panel
"
)
.
contains
(
"
Created At is April 24–30, 2022
"
)
.
click
();
popover
().
within
(()
=>
{
cy
.
findByTestId
(
"
between-date-picker
"
).
within
(()
=>
{
datePickerInput
(
0
,
0
).
should
(
"
have.value
"
,
"
04/24/2022
"
);
datePickerInput
(
1
,
0
).
should
(
"
have.value
"
,
"
04/30/2022
"
);
});
});
});
it
(
"
should display correct day range in filter pill when drilling into a month
"
,
()
=>
{
setup
(
"
month
"
);
cy
.
get
(
"
.dot
"
).
eq
(
0
).
click
({
force
:
true
});
popover
().
contains
(
"
See this Order
"
).
click
();
cy
.
findByTestId
(
"
qb-filters-panel
"
)
.
contains
(
"
Created At is April 2022
"
)
.
click
();
popover
().
within
(()
=>
{
cy
.
findByTestId
(
"
between-date-picker
"
).
within
(()
=>
{
datePickerInput
(
0
,
0
).
should
(
"
have.value
"
,
"
04/01/2022
"
);
datePickerInput
(
1
,
0
).
should
(
"
have.value
"
,
"
04/30/2022
"
);
});
});
});
it
(
"
should display correct day range in filter pill when drilling into a hour
"
,
()
=>
{
setup
(
"
hour
"
);
cy
.
get
(
"
.dot
"
).
eq
(
0
).
click
({
force
:
true
});
popover
().
contains
(
"
See this Order
"
).
click
();
cy
.
findByTestId
(
"
qb-filters-panel
"
)
.
contains
(
"
Created At is April 30, 2022, 6:00–59 PM
"
)
.
click
();
popover
().
within
(()
=>
{
cy
.
findByTestId
(
"
between-date-picker
"
).
within
(()
=>
{
datePickerInput
(
0
,
0
).
should
(
"
have.value
"
,
"
04/30/2022
"
);
datePickerInput
(
0
,
1
).
should
(
"
have.value
"
,
"
6
"
);
datePickerInput
(
0
,
2
).
should
(
"
have.value
"
,
"
00
"
);
datePickerInput
(
1
,
0
).
should
(
"
have.value
"
,
"
04/30/2022
"
);
datePickerInput
(
1
,
1
).
should
(
"
have.value
"
,
"
6
"
);
datePickerInput
(
1
,
2
).
should
(
"
have.value
"
,
"
59
"
);
});
});
});
it
(
"
should display correct minute in filter pill when drilling into a minute
"
,
()
=>
{
setup
(
"
minute
"
);
cy
.
get
(
"
.dot
"
).
eq
(
0
).
click
({
force
:
true
});
popover
().
contains
(
"
See this Order
"
).
click
();
cy
.
findByTestId
(
"
qb-filters-panel
"
)
.
contains
(
"
Created At is April 30, 2022, 6:56 PM
"
)
.
click
();
popover
().
within
(()
=>
{
datePickerInput
(
0
,
0
).
should
(
"
have.value
"
,
"
04/30/2022
"
);
datePickerInput
(
0
,
1
).
should
(
"
have.value
"
,
"
6
"
);
datePickerInput
(
0
,
2
).
should
(
"
have.value
"
,
"
56
"
);
});
});
it
(
"
should display correct minute in filter pill when drilling into a day
"
,
()
=>
{
setup
(
"
day
"
);
cy
.
get
(
"
.dot
"
).
eq
(
0
).
click
({
force
:
true
});
popover
().
contains
(
"
See this Order
"
).
click
();
cy
.
findByTestId
(
"
qb-filters-panel
"
)
.
contains
(
"
Created At is April 30, 2022
"
)
.
click
();
popover
().
within
(()
=>
{
datePickerInput
(
0
,
0
).
should
(
"
have.value
"
,
"
04/30/2022
"
);
});
});
});
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