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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
59f666da
Commit
59f666da
authored
Nov 08, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file action specs
parent
6a34d254
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
spec/javascripts/repo/stores/actions/file_spec.js
spec/javascripts/repo/stores/actions/file_spec.js
+44
-0
No files found.
spec/javascripts/repo/stores/actions/file_spec.js
View file @
59f666da
import
store
from
'
~/repo/stores
'
;
import
service
from
'
~/repo/services
'
;
import
{
file
}
from
'
../../helpers
'
;
describe
(
'
Multi-file store file actions
'
,
()
=>
{
describe
(
'
closeFile
'
,
()
=>
{
...
...
@@ -12,11 +16,51 @@ describe('Multi-file store file actions', () => {
});
describe
(
'
getRawFileData
'
,
()
=>
{
let
tmpFile
;
beforeEach
(()
=>
{
spyOn
(
service
,
'
getRawFileData
'
).
and
.
returnValue
(
Promise
.
resolve
(
'
raw
'
));
tmpFile
=
file
();
});
it
(
'
calls getRawFileData service method
'
,
(
done
)
=>
{
store
.
dispatch
(
'
getRawFileData
'
,
tmpFile
)
.
then
(()
=>
{
expect
(
service
.
getRawFileData
).
toHaveBeenCalledWith
(
tmpFile
);
done
();
}).
catch
(
done
.
fail
);
});
it
(
'
updates file raw data
'
,
(
done
)
=>
{
store
.
dispatch
(
'
getRawFileData
'
,
tmpFile
)
.
then
(()
=>
{
expect
(
tmpFile
.
raw
).
toBe
(
'
raw
'
);
done
();
}).
catch
(
done
.
fail
);
});
});
describe
(
'
changeFileContent
'
,
()
=>
{
let
tmpFile
;
beforeEach
(()
=>
{
tmpFile
=
file
();
});
it
(
'
updates file content
'
,
(
done
)
=>
{
store
.
dispatch
(
'
changeFileContent
'
,
{
file
:
tmpFile
,
content
:
'
content
'
,
})
.
then
(()
=>
{
expect
(
tmpFile
.
content
).
toBe
(
'
content
'
);
done
();
}).
catch
(
done
.
fail
);
});
});
describe
(
'
createTempFile
'
,
()
=>
{
...
...
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