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
6d48f5fc
Commit
6d48f5fc
authored
Oct 07, 2021
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use import for JSON fixtures
- ee/spec/frontend/pipelines - spec/frontend/pipelines - spec/frontend/commit
parent
d6fb5dd9
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
21 additions
and
30 deletions
+21
-30
ee/spec/frontend/pipelines/pipelines_table_spec.js
ee/spec/frontend/pipelines/pipelines_table_spec.js
+3
-3
spec/frontend/commit/commit_pipeline_status_component_spec.js
.../frontend/commit/commit_pipeline_status_component_spec.js
+2
-2
spec/frontend/commit/pipelines/pipelines_table_spec.js
spec/frontend/commit/pipelines/pipelines_table_spec.js
+2
-2
spec/frontend/pipelines/components/pipelines_list/pipeline_mini_graph_spec.js
...nes/components/pipelines_list/pipeline_mini_graph_spec.js
+1
-1
spec/frontend/pipelines/pipelines_spec.js
spec/frontend/pipelines/pipelines_spec.js
+1
-1
spec/frontend/pipelines/pipelines_table_spec.js
spec/frontend/pipelines/pipelines_table_spec.js
+3
-3
spec/frontend/pipelines/test_reports/stores/actions_spec.js
spec/frontend/pipelines/test_reports/stores/actions_spec.js
+1
-2
spec/frontend/pipelines/test_reports/stores/getters_spec.js
spec/frontend/pipelines/test_reports/stores/getters_spec.js
+1
-3
spec/frontend/pipelines/test_reports/stores/mutations_spec.js
.../frontend/pipelines/test_reports/stores/mutations_spec.js
+1
-3
spec/frontend/pipelines/test_reports/test_reports_spec.js
spec/frontend/pipelines/test_reports/test_reports_spec.js
+1
-3
spec/frontend/pipelines/test_reports/test_suite_table_spec.js
.../frontend/pipelines/test_reports/test_suite_table_spec.js
+2
-2
spec/frontend/pipelines/test_reports/test_summary_spec.js
spec/frontend/pipelines/test_reports/test_summary_spec.js
+2
-2
spec/frontend/pipelines/test_reports/test_summary_table_spec.js
...rontend/pipelines/test_reports/test_summary_table_spec.js
+1
-3
No files found.
ee/spec/frontend/pipelines/pipelines_table_spec.js
View file @
6d48f5fc
import
{
mount
}
from
'
@vue/test-utils
'
;
import
fixture
from
'
test_fixtures/pipelines/pipelines.json
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
PipelinesTable
from
'
~/pipelines/components/pipelines_list/pipelines_table.vue
'
;
import
{
PipelineKeyOptions
}
from
'
~/pipelines/constants
'
;
...
...
@@ -11,8 +12,6 @@ describe('Pipelines Table', () => {
let
pipeline
;
let
wrapper
;
const
jsonFixtureName
=
'
pipelines/pipelines.json
'
;
const
defaultProps
=
{
pipelines
:
[],
viewType
:
'
root
'
,
...
...
@@ -20,7 +19,8 @@ describe('Pipelines Table', () => {
};
const
createMockPipeline
=
()
=>
{
const
{
pipelines
}
=
getJSONFixture
(
jsonFixtureName
);
// Clone fixture as it could be modified by tests
const
{
pipelines
}
=
JSON
.
parse
(
JSON
.
stringify
(
fixture
));
return
pipelines
.
find
((
p
)
=>
p
.
user
!==
null
&&
p
.
commit
!==
null
);
};
...
...
spec/frontend/commit/commit_pipeline_status_component_spec.js
View file @
6d48f5fc
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Visibility
from
'
visibilityjs
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
fixture
from
'
test_fixtures/pipelines/pipelines.json
'
;
import
createFlash
from
'
~/flash
'
;
import
Poll
from
'
~/lib/utils/poll
'
;
import
CommitPipelineStatus
from
'
~/projects/tree/components/commit_pipeline_status_component.vue
'
;
...
...
@@ -20,7 +20,7 @@ jest.mock('~/projects/tree/services/commit_pipeline_service', () =>
describe
(
'
Commit pipeline status component
'
,
()
=>
{
let
wrapper
;
const
{
pipelines
}
=
getJSONFixture
(
'
pipelines/pipelines.json
'
)
;
const
{
pipelines
}
=
fixture
;
const
{
status
:
mockCiStatus
}
=
pipelines
[
0
].
details
;
const
defaultProps
=
{
...
...
spec/frontend/commit/pipelines/pipelines_table_spec.js
View file @
6d48f5fc
import
{
GlEmptyState
,
GlLoadingIcon
,
GlModal
,
GlTable
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
fixture
from
'
test_fixtures/pipelines/pipelines.json
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
Api
from
'
~/api
'
;
...
...
@@ -8,7 +9,6 @@ import PipelinesTable from '~/commit/pipelines/pipelines_table.vue';
import
axios
from
'
~/lib/utils/axios_utils
'
;
describe
(
'
Pipelines table in Commits and Merge requests
'
,
()
=>
{
const
jsonFixtureName
=
'
pipelines/pipelines.json
'
;
let
wrapper
;
let
pipeline
;
let
mock
;
...
...
@@ -37,7 +37,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
beforeEach
(()
=>
{
mock
=
new
MockAdapter
(
axios
);
const
{
pipelines
}
=
getJSONFixture
(
jsonFixtureName
)
;
const
{
pipelines
}
=
fixture
;
pipeline
=
pipelines
.
find
((
p
)
=>
p
.
user
!==
null
&&
p
.
commit
!==
null
);
});
...
...
spec/frontend/pipelines/components/pipelines_list/pipeline_mini_graph_spec.js
View file @
6d48f5fc
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
pipelines
}
from
'
test_fixtures/pipelines/pipelines.json
'
;
import
PipelineMiniGraph
from
'
~/pipelines/components/pipelines_list/pipeline_mini_graph.vue
'
;
import
PipelineStage
from
'
~/pipelines/components/pipelines_list/pipeline_stage.vue
'
;
const
{
pipelines
}
=
getJSONFixture
(
'
pipelines/pipelines.json
'
);
const
mockStages
=
pipelines
[
0
].
details
.
stages
;
describe
(
'
Pipeline Mini Graph
'
,
()
=>
{
...
...
spec/frontend/pipelines/pipelines_spec.js
View file @
6d48f5fc
...
...
@@ -4,6 +4,7 @@ import { mount } from '@vue/test-utils';
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
chunk
}
from
'
lodash
'
;
import
{
nextTick
}
from
'
vue
'
;
import
mockPipelinesResponse
from
'
test_fixtures/pipelines/pipelines.json
'
;
import
setWindowLocation
from
'
helpers/set_window_location_helper
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
...
...
@@ -33,7 +34,6 @@ jest.mock('~/experimentation/utils', () => ({
const
mockProjectPath
=
'
twitter/flight
'
;
const
mockProjectId
=
'
21
'
;
const
mockPipelinesEndpoint
=
`/
${
mockProjectPath
}
/pipelines.json`
;
const
mockPipelinesResponse
=
getJSONFixture
(
'
pipelines/pipelines.json
'
);
const
mockPipelinesIds
=
mockPipelinesResponse
.
pipelines
.
map
(({
id
})
=>
id
);
const
mockPipelineWithStages
=
mockPipelinesResponse
.
pipelines
.
find
(
(
p
)
=>
p
.
details
.
stages
&&
p
.
details
.
stages
.
length
,
...
...
spec/frontend/pipelines/pipelines_table_spec.js
View file @
6d48f5fc
import
'
~/commons
'
;
import
{
GlTable
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
fixture
from
'
test_fixtures/pipelines/pipelines.json
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
PipelineMiniGraph
from
'
~/pipelines/components/pipelines_list/pipeline_mini_graph.vue
'
;
import
PipelineOperations
from
'
~/pipelines/components/pipelines_list/pipeline_operations.vue
'
;
...
...
@@ -20,8 +21,6 @@ describe('Pipelines Table', () => {
let
pipeline
;
let
wrapper
;
const
jsonFixtureName
=
'
pipelines/pipelines.json
'
;
const
defaultProps
=
{
pipelines
:
[],
viewType
:
'
root
'
,
...
...
@@ -29,7 +28,8 @@ describe('Pipelines Table', () => {
};
const
createMockPipeline
=
()
=>
{
const
{
pipelines
}
=
getJSONFixture
(
jsonFixtureName
);
// Clone fixture as it could be modified by tests
const
{
pipelines
}
=
JSON
.
parse
(
JSON
.
stringify
(
fixture
));
return
pipelines
.
find
((
p
)
=>
p
.
user
!==
null
&&
p
.
commit
!==
null
);
};
...
...
spec/frontend/pipelines/test_reports/stores/actions_spec.js
View file @
6d48f5fc
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
testReports
from
'
test_fixtures/pipelines/test_report.json
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
createFlash
from
'
~/flash
'
;
...
...
@@ -13,7 +13,6 @@ describe('Actions TestReports Store', () => {
let
mock
;
let
state
;
const
testReports
=
getJSONFixture
(
'
pipelines/test_report.json
'
);
const
summary
=
{
total_count
:
1
};
const
suiteEndpoint
=
`
${
TEST_HOST
}
/tests/suite.json`
;
...
...
spec/frontend/pipelines/test_reports/stores/getters_spec.js
View file @
6d48f5fc
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
testReports
from
'
test_fixtures/pipelines/test_report.json
'
;
import
*
as
getters
from
'
~/pipelines/stores/test_reports/getters
'
;
import
{
iconForTestStatus
,
...
...
@@ -9,8 +9,6 @@ import {
describe
(
'
Getters TestReports Store
'
,
()
=>
{
let
state
;
const
testReports
=
getJSONFixture
(
'
pipelines/test_report.json
'
);
const
defaultState
=
{
blobPath
:
'
/test/blob/path
'
,
testReports
,
...
...
spec/frontend/pipelines/test_reports/stores/mutations_spec.js
View file @
6d48f5fc
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
testReports
from
'
test_fixtures/pipelines/test_report.json
'
;
import
*
as
types
from
'
~/pipelines/stores/test_reports/mutation_types
'
;
import
mutations
from
'
~/pipelines/stores/test_reports/mutations
'
;
describe
(
'
Mutations TestReports Store
'
,
()
=>
{
let
mockState
;
const
testReports
=
getJSONFixture
(
'
pipelines/test_report.json
'
);
const
defaultState
=
{
endpoint
:
''
,
testReports
:
{},
...
...
spec/frontend/pipelines/test_reports/test_reports_spec.js
View file @
6d48f5fc
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
testReports
from
'
test_fixtures/pipelines/test_report.json
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
EmptyState
from
'
~/pipelines/components/test_reports/empty_state.vue
'
;
import
TestReports
from
'
~/pipelines/components/test_reports/test_reports.vue
'
;
...
...
@@ -16,8 +16,6 @@ describe('Test reports app', () => {
let
wrapper
;
let
store
;
const
testReports
=
getJSONFixture
(
'
pipelines/test_report.json
'
);
const
loadingSpinner
=
()
=>
wrapper
.
findComponent
(
GlLoadingIcon
);
const
testsDetail
=
()
=>
wrapper
.
findByTestId
(
'
tests-detail
'
);
const
emptyState
=
()
=>
wrapper
.
findComponent
(
EmptyState
);
...
...
spec/frontend/pipelines/test_reports/test_suite_table_spec.js
View file @
6d48f5fc
import
{
GlButton
,
GlFriendlyWrap
,
GlLink
,
GlPagination
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
testReports
from
'
test_fixtures/pipelines/test_report.json
'
;
import
SuiteTable
from
'
~/pipelines/components/test_reports/test_suite_table.vue
'
;
import
{
TestStatus
}
from
'
~/pipelines/constants
'
;
import
*
as
getters
from
'
~/pipelines/stores/test_reports/getters
'
;
...
...
@@ -17,7 +17,7 @@ describe('Test reports suite table', () => {
const
{
test_suites
:
[
testSuite
],
}
=
getJSONFixture
(
'
pipelines/test_report.json
'
)
;
}
=
testReports
;
testSuite
.
test_cases
=
[...
testSuite
.
test_cases
,
...
skippedTestCases
];
const
testCases
=
testSuite
.
test_cases
;
...
...
spec/frontend/pipelines/test_reports/test_summary_spec.js
View file @
6d48f5fc
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
testReports
from
'
test_fixtures/pipelines/test_report.json
'
;
import
Summary
from
'
~/pipelines/components/test_reports/test_summary.vue
'
;
import
{
formattedTime
}
from
'
~/pipelines/stores/test_reports/utils
'
;
...
...
@@ -8,7 +8,7 @@ describe('Test reports summary', () => {
const
{
test_suites
:
[
testSuite
],
}
=
getJSONFixture
(
'
pipelines/test_report.json
'
)
;
}
=
testReports
;
const
backButton
=
()
=>
wrapper
.
find
(
'
.js-back-button
'
);
const
totalTests
=
()
=>
wrapper
.
find
(
'
.js-total-tests
'
);
...
...
spec/frontend/pipelines/test_reports/test_summary_table_spec.js
View file @
6d48f5fc
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
testReports
from
'
test_fixtures/pipelines/test_report.json
'
;
import
SummaryTable
from
'
~/pipelines/components/test_reports/test_summary_table.vue
'
;
import
*
as
getters
from
'
~/pipelines/stores/test_reports/getters
'
;
...
...
@@ -11,8 +11,6 @@ describe('Test reports summary table', () => {
let
wrapper
;
let
store
;
const
testReports
=
getJSONFixture
(
'
pipelines/test_report.json
'
);
const
allSuitesRows
=
()
=>
wrapper
.
findAll
(
'
.js-suite-row
'
);
const
noSuitesToShow
=
()
=>
wrapper
.
find
(
'
.js-no-tests-suites
'
);
...
...
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