BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
59f666da
Unverified
Commit
59f666da
authored
Nov 08, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file action specs
parent
6a34d254
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
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