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
bba3fab3
Commit
bba3fab3
authored
Oct 07, 2021
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use import for JSON fixtures
- spec/frontend/jobs - spec/frontend/releases
parent
d6fb5dd9
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
22 additions
and
65 deletions
+22
-65
spec/frontend/jobs/components/job_app_spec.js
spec/frontend/jobs/components/job_app_spec.js
+1
-3
spec/frontend/jobs/components/job_container_item_spec.js
spec/frontend/jobs/components/job_container_item_spec.js
+1
-1
spec/frontend/jobs/mixins/delayed_job_mixin_spec.js
spec/frontend/jobs/mixins/delayed_job_mixin_spec.js
+1
-1
spec/frontend/releases/components/app_edit_new_spec.js
spec/frontend/releases/components/app_edit_new_spec.js
+1
-2
spec/frontend/releases/components/app_index_apollo_client_spec.js
...ntend/releases/components/app_index_apollo_client_spec.js
+1
-3
spec/frontend/releases/components/app_show_spec.js
spec/frontend/releases/components/app_show_spec.js
+1
-5
spec/frontend/releases/components/asset_links_form_spec.js
spec/frontend/releases/components/asset_links_form_spec.js
+1
-3
spec/frontend/releases/components/evidence_block_spec.js
spec/frontend/releases/components/evidence_block_spec.js
+1
-3
spec/frontend/releases/components/release_block_assets_spec.js
...frontend/releases/components/release_block_assets_spec.js
+1
-3
spec/frontend/releases/components/release_block_footer_spec.js
...frontend/releases/components/release_block_footer_spec.js
+1
-3
spec/frontend/releases/components/release_block_header_spec.js
...frontend/releases/components/release_block_header_spec.js
+1
-3
spec/frontend/releases/components/release_block_milestone_info_spec.js
.../releases/components/release_block_milestone_info_spec.js
+2
-2
spec/frontend/releases/components/release_block_spec.js
spec/frontend/releases/components/release_block_spec.js
+1
-3
spec/frontend/releases/stores/modules/detail/actions_spec.js
spec/frontend/releases/stores/modules/detail/actions_spec.js
+1
-5
spec/frontend/releases/stores/modules/detail/mutations_spec.js
...frontend/releases/stores/modules/detail/mutations_spec.js
+1
-3
spec/frontend/releases/stores/modules/list/actions_spec.js
spec/frontend/releases/stores/modules/list/actions_spec.js
+1
-5
spec/frontend/releases/stores/modules/list/mutations_spec.js
spec/frontend/releases/stores/modules/list/mutations_spec.js
+2
-6
spec/frontend/releases/util_spec.js
spec/frontend/releases/util_spec.js
+3
-11
No files found.
spec/frontend/jobs/components/job_app_spec.js
View file @
bba3fab3
...
...
@@ -2,7 +2,7 @@ import { GlLoadingIcon } from '@gitlab/ui';
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
Vuex
from
'
vuex
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
delayedJobFixture
from
'
test_fixtures/jobs/delayed.json
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
EmptyState
from
'
~/jobs/components/empty_state.vue
'
;
import
EnvironmentsBlock
from
'
~/jobs/components/environments_block.vue
'
;
...
...
@@ -19,8 +19,6 @@ describe('Job App', () => {
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
const
delayedJobFixture
=
getJSONFixture
(
'
jobs/delayed.json
'
);
let
store
;
let
wrapper
;
let
mock
;
...
...
spec/frontend/jobs/components/job_container_item_spec.js
View file @
bba3fab3
import
{
GlIcon
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
delayedJobFixture
from
'
test_fixtures/jobs/delayed.json
'
;
import
JobContainerItem
from
'
~/jobs/components/job_container_item.vue
'
;
import
CiIcon
from
'
~/vue_shared/components/ci_icon.vue
'
;
import
job
from
'
../mock_data
'
;
describe
(
'
JobContainerItem
'
,
()
=>
{
let
wrapper
;
const
delayedJobFixture
=
getJSONFixture
(
'
jobs/delayed.json
'
);
const
findCiIconComponent
=
()
=>
wrapper
.
findComponent
(
CiIcon
);
const
findGlIconComponent
=
()
=>
wrapper
.
findComponent
(
GlIcon
);
...
...
spec/frontend/jobs/mixins/delayed_job_mixin_spec.js
View file @
bba3fab3
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
delayedJobFixture
from
'
test_fixtures/jobs/delayed.json
'
;
import
delayedJobMixin
from
'
~/jobs/mixins/delayed_job_mixin
'
;
describe
(
'
DelayedJobMixin
'
,
()
=>
{
let
wrapper
;
const
delayedJobFixture
=
getJSONFixture
(
'
jobs/delayed.json
'
);
const
dummyComponent
=
{
props
:
{
job
:
{
...
...
spec/frontend/releases/components/app_edit_new_spec.js
View file @
bba3fab3
...
...
@@ -3,7 +3,7 @@ import axios from 'axios';
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
merge
}
from
'
lodash
'
;
import
Vuex
from
'
vuex
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalRelease
from
'
test_fixtures/api/releases/release.json
'
;
import
setWindowLocation
from
'
helpers/set_window_location_helper
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
*
as
commonUtils
from
'
~/lib/utils/common_utils
'
;
...
...
@@ -11,7 +11,6 @@ import ReleaseEditNewApp from '~/releases/components/app_edit_new.vue';
import
AssetLinksForm
from
'
~/releases/components/asset_links_form.vue
'
;
import
{
BACK_URL_PARAM
}
from
'
~/releases/constants
'
;
const
originalRelease
=
getJSONFixture
(
'
api/releases/release.json
'
);
const
originalMilestones
=
originalRelease
.
milestones
;
const
releasesPagePath
=
'
path/to/releases/page
'
;
...
...
spec/frontend/releases/components/app_index_apollo_client_spec.js
View file @
bba3fab3
import
{
cloneDeep
}
from
'
lodash
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
originalAllReleasesQueryResponse
from
'
test_fixtures/graphql/releases/graphql/queries/all_releases.query.graphql.json
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
allReleasesQuery
from
'
shared_queries/releases/all_releases.query.graphql
'
;
...
...
@@ -32,9 +33,6 @@ jest.mock('~/lib/utils/url_utility', () => ({
}));
describe
(
'
app_index_apollo_client.vue
'
,
()
=>
{
const
originalAllReleasesQueryResponse
=
getJSONFixture
(
'
graphql/releases/graphql/queries/all_releases.query.graphql.json
'
,
);
const
projectPath
=
'
project/path
'
;
const
newReleasePath
=
'
path/to/new/release/page
'
;
const
before
=
'
beforeCursor
'
;
...
...
spec/frontend/releases/components/app_show_spec.js
View file @
bba3fab3
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
oneReleaseQueryResponse
from
'
test_fixtures/graphql/releases/graphql/queries/one_release.query.graphql.json
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createFlash
from
'
~/flash
'
;
import
ReleaseShowApp
from
'
~/releases/components/app_show.vue
'
;
...
...
@@ -11,10 +11,6 @@ import oneReleaseQuery from '~/releases/graphql/queries/one_release.query.graphq
jest
.
mock
(
'
~/flash
'
);
const
oneReleaseQueryResponse
=
getJSONFixture
(
'
graphql/releases/graphql/queries/one_release.query.graphql.json
'
,
);
Vue
.
use
(
VueApollo
);
const
EXPECTED_ERROR_MESSAGE
=
'
Something went wrong while getting the release details.
'
;
...
...
spec/frontend/releases/components/asset_links_form_spec.js
View file @
bba3fab3
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalRelease
from
'
test_fixtures/api/releases/release.json
'
;
import
*
as
commonUtils
from
'
~/lib/utils/common_utils
'
;
import
{
ENTER_KEY
}
from
'
~/lib/utils/keys
'
;
import
AssetLinksForm
from
'
~/releases/components/asset_links_form.vue
'
;
...
...
@@ -9,8 +9,6 @@ import { ASSET_LINK_TYPE, DEFAULT_ASSET_LINK_TYPE } from '~/releases/constants';
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
const
originalRelease
=
getJSONFixture
(
'
api/releases/release.json
'
);
describe
(
'
Release edit component
'
,
()
=>
{
let
wrapper
;
let
release
;
...
...
spec/frontend/releases/components/evidence_block_spec.js
View file @
bba3fab3
import
{
GlLink
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalRelease
from
'
test_fixtures/api/releases/release.json
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
{
truncateSha
}
from
'
~/lib/utils/text_utility
'
;
import
EvidenceBlock
from
'
~/releases/components/evidence_block.vue
'
;
import
ClipboardButton
from
'
~/vue_shared/components/clipboard_button.vue
'
;
const
originalRelease
=
getJSONFixture
(
'
api/releases/release.json
'
);
describe
(
'
Evidence Block
'
,
()
=>
{
let
wrapper
;
let
release
;
...
...
spec/frontend/releases/components/release_block_assets_spec.js
View file @
bba3fab3
import
{
GlCollapse
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
{
assets
}
from
'
test_fixtures/api/releases/release.json
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
ReleaseBlockAssets
from
'
~/releases/components/release_block_assets.vue
'
;
import
{
ASSET_LINK_TYPE
}
from
'
~/releases/constants
'
;
const
{
assets
}
=
getJSONFixture
(
'
api/releases/release.json
'
);
describe
(
'
Release block assets
'
,
()
=>
{
let
wrapper
;
let
defaultProps
;
...
...
spec/frontend/releases/components/release_block_footer_spec.js
View file @
bba3fab3
import
{
GlLink
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
cloneDeep
}
from
'
lodash
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalRelease
from
'
test_fixtures/api/releases/release.json
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
ReleaseBlockFooter
from
'
~/releases/components/release_block_footer.vue
'
;
const
originalRelease
=
getJSONFixture
(
'
api/releases/release.json
'
);
// TODO: Encapsulate date helpers https://gitlab.com/gitlab-org/gitlab/-/issues/320883
const
MONTHS_IN_MS
=
1000
*
60
*
60
*
24
*
31
;
const
mockFutureDate
=
new
Date
(
new
Date
().
getTime
()
+
MONTHS_IN_MS
).
toISOString
();
...
...
spec/frontend/releases/components/release_block_header_spec.js
View file @
bba3fab3
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalRelease
from
'
test_fixtures/api/releases/release.json
'
;
import
setWindowLocation
from
'
helpers/set_window_location_helper
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
ReleaseBlockHeader
from
'
~/releases/components/release_block_header.vue
'
;
import
{
BACK_URL_PARAM
}
from
'
~/releases/constants
'
;
const
originalRelease
=
getJSONFixture
(
'
api/releases/release.json
'
);
describe
(
'
Release block header
'
,
()
=>
{
let
wrapper
;
let
release
;
...
...
spec/frontend/releases/components/release_block_milestone_info_spec.js
View file @
bba3fab3
import
{
GlProgressBar
,
GlLink
,
GlBadge
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalRelease
from
'
test_fixtures/api/releases/release.json
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
ReleaseBlockMilestoneInfo
from
'
~/releases/components/release_block_milestone_info.vue
'
;
import
{
MAX_MILESTONES_TO_DISPLAY
}
from
'
~/releases/constants
'
;
const
{
milestones
:
originalMilestones
}
=
getJSONFixture
(
'
api/releases/release.json
'
)
;
const
{
milestones
:
originalMilestones
}
=
originalRelease
;
describe
(
'
Release block milestone info
'
,
()
=>
{
let
wrapper
;
...
...
spec/frontend/releases/components/release_block_spec.js
View file @
bba3fab3
import
{
mount
}
from
'
@vue/test-utils
'
;
import
$
from
'
jquery
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalRelease
from
'
test_fixtures/api/releases/release.json
'
;
import
*
as
commonUtils
from
'
~/lib/utils/common_utils
'
;
import
*
as
urlUtility
from
'
~/lib/utils/url_utility
'
;
import
EvidenceBlock
from
'
~/releases/components/evidence_block.vue
'
;
...
...
@@ -9,8 +9,6 @@ import ReleaseBlockFooter from '~/releases/components/release_block_footer.vue';
import
{
BACK_URL_PARAM
}
from
'
~/releases/constants
'
;
import
timeagoMixin
from
'
~/vue_shared/mixins/timeago
'
;
const
originalRelease
=
getJSONFixture
(
'
api/releases/release.json
'
);
describe
(
'
Release block
'
,
()
=>
{
let
wrapper
;
let
release
;
...
...
spec/frontend/releases/stores/modules/detail/actions_spec.js
View file @
bba3fab3
import
{
cloneDeep
}
from
'
lodash
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalOneReleaseForEditingQueryResponse
from
'
test_fixtures/graphql/releases/graphql/queries/one_release_for_editing.query.graphql.json
'
;
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
createFlash
from
'
~/flash
'
;
import
{
redirectTo
}
from
'
~/lib/utils/url_utility
'
;
...
...
@@ -27,10 +27,6 @@ jest.mock('~/releases/util', () => ({
},
}));
const
originalOneReleaseForEditingQueryResponse
=
getJSONFixture
(
'
graphql/releases/graphql/queries/one_release_for_editing.query.graphql.json
'
,
);
describe
(
'
Release edit/new actions
'
,
()
=>
{
let
state
;
let
releaseResponse
;
...
...
spec/frontend/releases/stores/modules/detail/mutations_spec.js
View file @
bba3fab3
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalRelease
from
'
test_fixtures/api/releases/release.json
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
{
ASSET_LINK_TYPE
,
DEFAULT_ASSET_LINK_TYPE
}
from
'
~/releases/constants
'
;
import
*
as
types
from
'
~/releases/stores/modules/edit_new/mutation_types
'
;
import
mutations
from
'
~/releases/stores/modules/edit_new/mutations
'
;
import
createState
from
'
~/releases/stores/modules/edit_new/state
'
;
const
originalRelease
=
getJSONFixture
(
'
api/releases/release.json
'
);
describe
(
'
Release edit/new mutations
'
,
()
=>
{
let
state
;
let
release
;
...
...
spec/frontend/releases/stores/modules/list/actions_spec.js
View file @
bba3fab3
import
{
cloneDeep
}
from
'
lodash
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalGraphqlReleasesResponse
from
'
test_fixtures/graphql/releases/graphql/queries/all_releases.query.graphql.json
'
;
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
{
PAGE_SIZE
}
from
'
~/releases/constants
'
;
import
allReleasesQuery
from
'
~/releases/graphql/queries/all_releases.query.graphql
'
;
...
...
@@ -12,10 +12,6 @@ import * as types from '~/releases/stores/modules/index/mutation_types';
import
createState
from
'
~/releases/stores/modules/index/state
'
;
import
{
gqClient
,
convertAllReleasesGraphQLResponse
}
from
'
~/releases/util
'
;
const
originalGraphqlReleasesResponse
=
getJSONFixture
(
'
graphql/releases/graphql/queries/all_releases.query.graphql.json
'
,
);
describe
(
'
Releases State actions
'
,
()
=>
{
let
mockedState
;
let
graphqlReleasesResponse
;
...
...
spec/frontend/releases/stores/modules/list/mutations_spec.js
View file @
bba3fab3
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalRelease
from
'
test_fixtures/api/releases/release.json
'
;
import
graphqlReleasesResponse
from
'
test_fixtures/graphql/releases/graphql/queries/all_releases.query.graphql.json
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
*
as
types
from
'
~/releases/stores/modules/index/mutation_types
'
;
import
mutations
from
'
~/releases/stores/modules/index/mutations
'
;
import
createState
from
'
~/releases/stores/modules/index/state
'
;
import
{
convertAllReleasesGraphQLResponse
}
from
'
~/releases/util
'
;
const
originalRelease
=
getJSONFixture
(
'
api/releases/release.json
'
);
const
originalReleases
=
[
originalRelease
];
const
graphqlReleasesResponse
=
getJSONFixture
(
'
graphql/releases/graphql/queries/all_releases.query.graphql.json
'
,
);
describe
(
'
Releases Store Mutations
'
,
()
=>
{
let
stateCopy
;
let
pageInfo
;
...
...
spec/frontend/releases/util_spec.js
View file @
bba3fab3
import
{
cloneDeep
}
from
'
lodash
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
originalAllReleasesQueryResponse
from
'
test_fixtures/graphql/releases/graphql/queries/all_releases.query.graphql.json
'
;
import
originalOneReleaseQueryResponse
from
'
test_fixtures/graphql/releases/graphql/queries/one_release.query.graphql.json
'
;
import
originalOneReleaseForEditingQueryResponse
from
'
test_fixtures/graphql/releases/graphql/queries/one_release_for_editing.query.graphql.json
'
;
import
{
convertGraphQLRelease
,
convertAllReleasesGraphQLResponse
,
convertOneReleaseGraphQLResponse
,
}
from
'
~/releases/util
'
;
const
originalAllReleasesQueryResponse
=
getJSONFixture
(
'
graphql/releases/graphql/queries/all_releases.query.graphql.json
'
,
);
const
originalOneReleaseQueryResponse
=
getJSONFixture
(
'
graphql/releases/graphql/queries/one_release.query.graphql.json
'
,
);
const
originalOneReleaseForEditingQueryResponse
=
getJSONFixture
(
'
graphql/releases/graphql/queries/one_release_for_editing.query.graphql.json
'
,
);
describe
(
'
releases/util.js
'
,
()
=>
{
describe
(
'
convertGraphQLRelease
'
,
()
=>
{
let
releaseFromResponse
;
...
...
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