Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7eefbca4
Commit
7eefbca4
authored
Mar 03, 2021
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add useFixturesFakeDate helper function
- This simply wraps useFakeDate but encapsualtes the args
parent
a4a219c7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
3 deletions
+8
-3
ee/spec/frontend/projects/pipelines/charts/components/deployment_frequency_charts_spec.js
...nes/charts/components/deployment_frequency_charts_spec.js
+2
-3
spec/frontend/__helpers__/fake_date/fixtures.js
spec/frontend/__helpers__/fake_date/fixtures.js
+4
-0
spec/frontend/__helpers__/fake_date/index.js
spec/frontend/__helpers__/fake_date/index.js
+1
-0
spec/support/helpers/javascript_fixtures_helpers.rb
spec/support/helpers/javascript_fixtures_helpers.rb
+1
-0
No files found.
ee/spec/frontend/projects/pipelines/charts/components/deployment_frequency_charts_spec.js
View file @
7eefbca4
...
...
@@ -2,7 +2,7 @@ import { GlSprintf, GlLink } from '@gitlab/ui';
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
useFakeDate
}
from
'
helpers/fake_date
'
;
import
{
useF
ixturesF
akeDate
}
from
'
helpers/fake_date
'
;
import
createFlash
from
'
~/flash
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
httpStatus
from
'
~/lib/utils/http_status
'
;
...
...
@@ -21,8 +21,7 @@ const last90DaysData = getJSONFixture(
);
describe
(
'
ee_component/projects/pipelines/charts/components/deployment_frequency_charts.vue
'
,
()
=>
{
// Set the current Date to the same value that is used when generating the fixtures
useFakeDate
(
2015
,
6
,
3
,
10
);
useFixturesFakeDate
();
let
DeploymentFrequencyCharts
;
...
...
spec/frontend/__helpers__/fake_date/fixtures.js
0 → 100644
View file @
7eefbca4
import
{
useFakeDate
}
from
'
./jest
'
;
// Also see spec/support/helpers/javascript_fixtures_helpers.rb
export
const
useFixturesFakeDate
=
()
=>
useFakeDate
(
2015
,
6
,
3
,
10
);
spec/frontend/__helpers__/fake_date/index.js
View file @
7eefbca4
export
*
from
'
./fake_date
'
;
export
*
from
'
./jest
'
;
export
*
from
'
./fixtures
'
;
spec/support/helpers/javascript_fixtures_helpers.rb
View file @
7eefbca4
...
...
@@ -12,6 +12,7 @@ module JavaScriptFixturesHelpers
included
do
|
base
|
base
.
around
do
|
example
|
# pick an arbitrary date from the past, so tests are not time dependent
# Also see spec/frontend/__helpers__/fake_date/jest.js
Timecop
.
freeze
(
Time
.
utc
(
2015
,
7
,
3
,
10
))
{
example
.
run
}
raise
NoMethodError
.
new
(
'You need to set `response` for the fixture generator! This will automatically happen with `type: :controller` or `type: :request`.'
,
'response'
)
unless
respond_to?
(
:response
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment