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
0bfb273e
Commit
0bfb273e
authored
Oct 14, 2021
by
Albert Salim
Committed by
Jose Ivan Vargas
Oct 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change getJSONFixture to import on static fixtures
parent
4ce6e16a
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
13 additions
and
36 deletions
+13
-36
config/webpack.config.js
config/webpack.config.js
+1
-0
ee/spec/frontend/related_items_tree/components/create_issue_form_spec.js
...d/related_items_tree/components/create_issue_form_spec.js
+1
-5
ee/spec/frontend/related_items_tree/components/related_items_tree_app_spec.js
...ated_items_tree/components/related_items_tree_app_spec.js
+1
-5
ee/spec/frontend/related_items_tree/store/actions_spec.js
ee/spec/frontend/related_items_tree/store/actions_spec.js
+1
-6
jest.config.base.js
jest.config.base.js
+1
-0
spec/frontend/deprecated_jquery_dropdown_spec.js
spec/frontend/deprecated_jquery_dropdown_spec.js
+2
-4
spec/frontend/filterable_list_spec.js
spec/frontend/filterable_list_spec.js
+1
-4
spec/frontend/projects/projects_filterable_list_spec.js
spec/frontend/projects/projects_filterable_list_spec.js
+1
-4
spec/frontend/vue_shared/components/project_selector/project_list_item_spec.js
...red/components/project_selector/project_list_item_spec.js
+2
-4
spec/frontend/vue_shared/components/project_selector/project_selector_spec.js
...ared/components/project_selector/project_selector_spec.js
+2
-4
No files found.
config/webpack.config.js
View file @
0bfb273e
...
...
@@ -198,6 +198,7 @@ if (!IS_PRODUCTION) {
Object
.
assign
(
alias
,
{
test_fixtures
:
path
.
join
(
ROOT_PATH
,
`tmp/tests/frontend/
${
fixtureDir
}
`
),
test_fixtures_static
:
path
.
join
(
ROOT_PATH
,
'
spec/frontend/fixtures/static
'
),
test_helpers
:
path
.
join
(
ROOT_PATH
,
'
spec/frontend_integration/test_helpers
'
),
});
}
...
...
ee/spec/frontend/related_items_tree/components/create_issue_form_spec.js
View file @
0bfb273e
...
...
@@ -11,8 +11,7 @@ import {
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
// eslint-disable-next-line import/no-deprecated
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
mockProjects
from
'
test_fixtures_static/projects.json
'
;
import
CreateIssueForm
from
'
ee/related_items_tree/components/create_issue_form.vue
'
;
import
createDefaultStore
from
'
ee/related_items_tree/store
'
;
import
ProjectAvatar
from
'
~/vue_shared/components/project_avatar.vue
'
;
...
...
@@ -24,9 +23,6 @@ import {
mockMixedFrequentlyUsedProjects
,
}
from
'
../mock_data
'
;
// eslint-disable-next-line import/no-deprecated
const
mockProjects
=
getJSONFixture
(
'
static/projects.json
'
);
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
...
...
ee/spec/frontend/related_items_tree/components/related_items_tree_app_spec.js
View file @
0bfb273e
...
...
@@ -3,22 +3,18 @@ import { shallowMount, createLocalVue } from '@vue/test-utils';
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
Vuex
from
'
vuex
'
;
import
mockProjects
from
'
test_fixtures_static/projects.json
'
;
import
CreateIssueForm
from
'
ee/related_items_tree/components/create_issue_form.vue
'
;
import
AddIssuableForm
from
'
~/related_issues/components/add_issuable_form.vue
'
;
import
SlotSwitch
from
'
~/vue_shared/components/slot_switch.vue
'
;
import
RelatedItemsTreeApp
from
'
ee/related_items_tree/components/related_items_tree_app.vue
'
;
import
RelatedItemsTreeHeader
from
'
ee/related_items_tree/components/related_items_tree_header.vue
'
;
import
createDefaultStore
from
'
ee/related_items_tree/store
'
;
// eslint-disable-next-line import/no-deprecated
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
issuableTypesMap
}
from
'
~/related_issues/constants
'
;
import
{
mockInitialConfig
,
mockParentItem
,
mockEpics
,
mockIssues
}
from
'
../mock_data
'
;
// eslint-disable-next-line import/no-deprecated
const
mockProjects
=
getJSONFixture
(
'
static/projects.json
'
);
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
...
...
ee/spec/frontend/related_items_tree/store/actions_spec.js
View file @
0bfb273e
import
MockAdapter
from
'
axios-mock-adapter
'
;
// eslint-disable-next-line import/no-deprecated
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
mockProjects
from
'
test_fixtures_static/projects.json
'
;
import
{
ChildType
,
ChildState
}
from
'
ee/related_items_tree/constants
'
;
import
*
as
actions
from
'
ee/related_items_tree/store/actions
'
;
import
*
as
types
from
'
ee/related_items_tree/store/mutation_types
'
;
...
...
@@ -31,9 +29,6 @@ import {
mockEpic1
,
}
from
'
../mock_data
'
;
// eslint-disable-next-line import/no-deprecated
const
mockProjects
=
getJSONFixture
(
'
static/projects.json
'
);
jest
.
mock
(
'
~/flash
'
);
describe
(
'
RelatedItemTree
'
,
()
=>
{
...
...
jest.config.base.js
View file @
0bfb273e
...
...
@@ -54,6 +54,7 @@ module.exports = (path, options = {}) => {
'
^helpers(/.*)$
'
:
'
<rootDir>/spec/frontend/__helpers__$1
'
,
'
^vendor(/.*)$
'
:
'
<rootDir>/vendor/assets/javascripts$1
'
,
[
TEST_FIXTURES_PATTERN
]:
'
<rootDir>/tmp/tests/frontend/fixtures$1
'
,
'
^test_fixtures_static(/.*)$
'
:
'
<rootDir>/spec/frontend/fixtures/static$1
'
,
'
\\
.(jpg|jpeg|png|svg|css)$
'
:
'
<rootDir>/spec/frontend/__mocks__/file_mock.js
'
,
'
emojis(/.*).json
'
:
'
<rootDir>/fixtures/emojis$1.json
'
,
'
^spec/test_constants$
'
:
'
<rootDir>/spec/frontend/__helpers__/test_constants
'
,
...
...
spec/frontend/deprecated_jquery_dropdown_spec.js
View file @
0bfb273e
/* eslint-disable no-param-reassign */
import
$
from
'
jquery
'
;
import
mockProjects
from
'
test_fixtures_static/projects.json
'
;
import
initDeprecatedJQueryDropdown
from
'
~/deprecated_jquery_dropdown
'
;
import
'
~/lib/utils/common_utils
'
;
// eslint-disable-next-line import/no-deprecated
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
{
visitUrl
}
from
'
~/lib/utils/url_utility
'
;
jest
.
mock
(
'
~/lib/utils/url_utility
'
,
()
=>
({
...
...
@@ -68,8 +67,7 @@ describe('deprecatedJQueryDropdown', () => {
loadFixtures
(
'
static/deprecated_jquery_dropdown.html
'
);
test
.
dropdownContainerElement
=
$
(
'
.dropdown.inline
'
);
test
.
$dropdownMenuElement
=
$
(
'
.dropdown-menu
'
,
test
.
dropdownContainerElement
);
// eslint-disable-next-line import/no-deprecated
test
.
projectsData
=
getJSONFixture
(
'
static/projects.json
'
);
test
.
projectsData
=
JSON
.
parse
(
JSON
.
stringify
(
mockProjects
));
});
afterEach
(()
=>
{
...
...
spec/frontend/filterable_list_spec.js
View file @
0bfb273e
// eslint-disable-next-line import/no-deprecated
import
{
getJSONFixture
,
setHTMLFixture
}
from
'
helpers/fixtures
'
;
import
{
setHTMLFixture
}
from
'
helpers/fixtures
'
;
import
FilterableList
from
'
~/filterable_list
'
;
describe
(
'
FilterableList
'
,
()
=>
{
...
...
@@ -15,8 +14,6 @@ describe('FilterableList', () => {
</div>
<div class="js-projects-list-holder"></div>
`
);
// eslint-disable-next-line import/no-deprecated
getJSONFixture
(
'
static/projects.json
'
);
form
=
document
.
querySelector
(
'
form#project-filter-form
'
);
filter
=
document
.
querySelector
(
'
.js-projects-list-filter
'
);
holder
=
document
.
querySelector
(
'
.js-projects-list-holder
'
);
...
...
spec/frontend/projects/projects_filterable_list_spec.js
View file @
0bfb273e
// eslint-disable-next-line import/no-deprecated
import
{
getJSONFixture
,
setHTMLFixture
}
from
'
helpers/fixtures
'
;
import
{
setHTMLFixture
}
from
'
helpers/fixtures
'
;
import
ProjectsFilterableList
from
'
~/projects/projects_filterable_list
'
;
describe
(
'
ProjectsFilterableList
'
,
()
=>
{
...
...
@@ -15,8 +14,6 @@ describe('ProjectsFilterableList', () => {
</div>
<div class="js-projects-list-holder"></div>
`
);
// eslint-disable-next-line import/no-deprecated
getJSONFixture
(
'
static/projects.json
'
);
form
=
document
.
querySelector
(
'
form#project-filter-form
'
);
filter
=
document
.
querySelector
(
'
.js-projects-list-filter
'
);
holder
=
document
.
querySelector
(
'
.js-projects-list-holder
'
);
...
...
spec/frontend/vue_shared/components/project_selector/project_list_item_spec.js
View file @
0bfb273e
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
// eslint-disable-next-line import/no-deprecated
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
mockProjects
from
'
test_fixtures_static/projects.json
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
ProjectAvatar
from
'
~/vue_shared/components/deprecated_project_avatar/default.vue
'
;
import
ProjectListItem
from
'
~/vue_shared/components/project_selector/project_list_item.vue
'
;
...
...
@@ -13,8 +12,7 @@ describe('ProjectListItem component', () => {
let
vm
;
let
options
;
// eslint-disable-next-line import/no-deprecated
const
project
=
getJSONFixture
(
'
static/projects.json
'
)[
0
];
const
project
=
JSON
.
parse
(
JSON
.
stringify
(
mockProjects
))[
0
];
beforeEach
(()
=>
{
options
=
{
...
...
spec/frontend/vue_shared/components/project_selector/project_selector_spec.js
View file @
0bfb273e
...
...
@@ -2,8 +2,7 @@ import { GlSearchBoxByType, GlInfiniteScroll } from '@gitlab/ui';
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
head
}
from
'
lodash
'
;
import
Vue
from
'
vue
'
;
// eslint-disable-next-line import/no-deprecated
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
mockProjects
from
'
test_fixtures_static/projects.json
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
ProjectListItem
from
'
~/vue_shared/components/project_selector/project_list_item.vue
'
;
import
ProjectSelector
from
'
~/vue_shared/components/project_selector/project_selector.vue
'
;
...
...
@@ -13,8 +12,7 @@ const localVue = createLocalVue();
describe
(
'
ProjectSelector component
'
,
()
=>
{
let
wrapper
;
let
vm
;
// eslint-disable-next-line import/no-deprecated
const
allProjects
=
getJSONFixture
(
'
static/projects.json
'
);
const
allProjects
=
mockProjects
;
const
searchResults
=
allProjects
.
slice
(
0
,
5
);
let
selected
=
[];
selected
=
selected
.
concat
(
allProjects
.
slice
(
0
,
3
)).
concat
(
allProjects
.
slice
(
5
,
8
));
...
...
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