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
79de7066
Commit
79de7066
authored
Jul 21, 2020
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup integration test setup
- Also moves special snapshot serializer to its own module.
parent
ef2177f6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
0 deletions
+46
-0
spec/frontend_integration/test_helpers/setup/index.js
spec/frontend_integration/test_helpers/setup/index.js
+4
-0
spec/frontend_integration/test_helpers/setup/setup_axios.js
spec/frontend_integration/test_helpers/setup/setup_axios.js
+5
-0
spec/frontend_integration/test_helpers/setup/setup_globals.js
.../frontend_integration/test_helpers/setup/setup_globals.js
+15
-0
spec/frontend_integration/test_helpers/setup/setup_serializers.js
...ntend_integration/test_helpers/setup/setup_serializers.js
+3
-0
spec/frontend_integration/test_helpers/snapshot_serializer.js
.../frontend_integration/test_helpers/snapshot_serializer.js
+18
-0
spec/frontend_integration/test_setup.js
spec/frontend_integration/test_setup.js
+1
-0
No files found.
spec/frontend_integration/test_helpers/setup/index.js
0 → 100644
View file @
79de7066
import
'
../../../frontend/test_setup
'
;
import
'
./setup_globals
'
;
import
'
./setup_axios
'
;
import
'
./setup_serializers
'
;
spec/frontend_integration/test_helpers/setup/setup_axios.js
0 → 100644
View file @
79de7066
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
adapter
from
'
axios/lib/adapters/xhr
'
;
// We're removing our default axios adapter because this is handled by our mock server now
axios
.
defaults
.
adapter
=
adapter
;
spec/frontend_integration/test_helpers/setup/setup_globals.js
0 → 100644
View file @
79de7066
import
{
setTestTimeout
}
from
'
helpers/timeout
'
;
beforeEach
(()
=>
{
window
.
gon
=
{
api_version
:
'
v4
'
,
relative_url_root
:
''
,
};
setTestTimeout
(
5000
);
jest
.
useRealTimers
();
});
afterEach
(()
=>
{
jest
.
useFakeTimers
();
});
spec/frontend_integration/test_helpers/setup/setup_serializers.js
0 → 100644
View file @
79de7066
import
defaultSerializer
from
'
../snapshot_serializer
'
;
expect
.
addSnapshotSerializer
(
defaultSerializer
);
spec/frontend_integration/test_helpers/snapshot_serializer.js
0 → 100644
View file @
79de7066
export
default
{
test
(
value
)
{
return
value
instanceof
HTMLElement
&&
!
value
.
$_hit
;
},
print
(
element
,
serialize
)
{
element
.
$_hit
=
true
;
element
.
querySelectorAll
(
'
[style]
'
).
forEach
(
el
=>
{
el
.
$_hit
=
true
;
if
(
el
.
style
.
display
===
'
none
'
)
{
el
.
textContent
=
'
(jest: contents hidden)
'
;
}
});
return
serialize
(
element
)
.
replace
(
/^
\s
*<!---->$/gm
,
''
)
.
replace
(
/
\n\s
*
\n
/gm
,
'
\n
'
);
},
};
spec/frontend_integration/test_setup.js
0 → 100644
View file @
79de7066
import
'
./test_helpers/setup
'
;
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