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
7a73d29e
Commit
7a73d29e
authored
Feb 09, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec fixes
parent
389a4efc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
21 deletions
+33
-21
app/assets/javascripts/ide/stores/actions/tree.js
app/assets/javascripts/ide/stores/actions/tree.js
+7
-5
spec/javascripts/repo/components/repo_file_spec.js
spec/javascripts/repo/components/repo_file_spec.js
+1
-1
spec/javascripts/repo/stores/actions/file_spec.js
spec/javascripts/repo/stores/actions/file_spec.js
+0
-14
spec/javascripts/repo/stores/actions/tree_spec.js
spec/javascripts/repo/stores/actions/tree_spec.js
+25
-1
No files found.
app/assets/javascripts/ide/stores/actions/tree.js
View file @
7a73d29e
...
...
@@ -182,16 +182,18 @@ export const updateDirectoryData = (
state
,
});
cons
t
formattedData
=
[
le
t
formattedData
=
[
...
data
.
trees
.
map
(
t
=>
createEntry
(
t
,
'
tree
'
)),
...
data
.
submodules
.
map
(
m
=>
createEntry
(
m
,
'
submodule
'
)),
...
data
.
blobs
.
map
(
b
=>
createEntry
(
b
,
'
blob
'
)),
];
if
(
!
clearTree
)
{
formattedData
.
push
(
state
.
changedFiles
.
filter
(
f
=>
f
.
tempFile
&&
f
.
path
===
`
${
tree
.
path
}
/
${
f
.
name
}
`
),
);
if
(
!
clearTree
&&
tree
)
{
const
tempFiles
=
state
.
changedFiles
.
filter
(
f
=>
f
.
tempFile
&&
f
.
path
===
`
${
tree
.
path
}
/
${
f
.
name
}
`
);
if
(
tempFiles
.
length
)
{
formattedData
=
formattedData
.
concat
(
tempFiles
);
}
}
commit
(
types
.
SET_DIRECTORY_DATA
,
{
tree
:
selectedTree
,
data
:
formattedData
});
...
...
spec/javascripts/repo/components/repo_file_spec.js
View file @
7a73d29e
...
...
@@ -66,7 +66,7 @@ describe('RepoFile', () => {
spyOn
(
vm
,
'
clickFile
'
);
vm
.
$el
.
click
();
vm
.
$el
.
querySelector
(
'
td
'
).
click
();
expect
(
vm
.
clickFile
).
toHaveBeenCalledWith
(
vm
.
file
);
});
...
...
spec/javascripts/repo/stores/actions/file_spec.js
View file @
7a73d29e
...
...
@@ -55,20 +55,6 @@ describe('Multi-file store file actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
sets next file as active
'
,
(
done
)
=>
{
const
f
=
file
(
'
otherfile
'
);
store
.
state
.
openFiles
.
push
(
f
);
expect
(
f
.
active
).
toBeFalsy
();
store
.
dispatch
(
'
closeFile
'
,
localFile
)
.
then
(()
=>
{
expect
(
f
.
active
).
toBeTruthy
();
done
();
}).
catch
(
done
.
fail
);
});
it
(
'
calls getLastCommitData
'
,
(
done
)
=>
{
store
.
dispatch
(
'
closeFile
'
,
localFile
)
.
then
(()
=>
{
...
...
spec/javascripts/repo/stores/actions/tree_spec.js
View file @
7a73d29e
...
...
@@ -39,7 +39,7 @@ describe('Multi-file store tree actions', () => {
last_commit_path
:
'
last_commit_path
'
,
parent_tree_url
:
'
parent_tree_url
'
,
path
:
'
/
'
,
trees
:
[{
name
:
'
tree
'
}],
trees
:
[{
name
:
'
tree
'
,
path
:
'
tree
'
}],
blobs
:
[{
name
:
'
blob
'
}],
submodules
:
[{
name
:
'
submodule
'
}],
}),
...
...
@@ -68,6 +68,30 @@ describe('Multi-file store tree actions', () => {
}).
catch
(
done
.
fail
);
});
it
(
'
adds temp files into tree
'
,
(
done
)
=>
{
const
f
=
{
...
file
(
'
tempFile
'
),
path
:
'
tree/tempFile
'
,
tempFile
:
true
,
};
store
.
state
.
changedFiles
.
push
(
f
);
store
.
dispatch
(
'
getTreeData
'
,
basicCallParameters
)
.
then
(()
=>
store
.
dispatch
(
'
getTreeData
'
,
{
...
basicCallParameters
,
tree
:
store
.
state
.
trees
[
'
abcproject/master
'
].
tree
[
0
],
}))
.
then
(()
=>
{
const
tree
=
store
.
state
.
trees
[
'
abcproject/master
'
].
tree
[
0
].
tree
;
expect
(
tree
.
length
).
toBe
(
4
);
expect
(
tree
[
3
].
name
).
toBe
(
f
.
name
);
done
();
}).
catch
(
done
.
fail
);
});
it
(
'
sets parent tree URL
'
,
(
done
)
=>
{
store
.
dispatch
(
'
getTreeData
'
,
basicCallParameters
)
.
then
(()
=>
{
...
...
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