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
90b9d07f
Commit
90b9d07f
authored
Feb 09, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more specs
typo fix
🙈
parent
7a73d29e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
3 deletions
+59
-3
app/assets/javascripts/ide/stores/utils.js
app/assets/javascripts/ide/stores/utils.js
+3
-3
spec/javascripts/repo/stores/actions/tree_spec.js
spec/javascripts/repo/stores/actions/tree_spec.js
+56
-0
No files found.
app/assets/javascripts/ide/stores/utils.js
View file @
90b9d07f
...
...
@@ -163,10 +163,10 @@ export const createOrMergeEntry = ({ projectId,
level
,
state
})
=>
{
if
(
state
.
changedFiles
.
length
)
{
const
foundChangedFile
File
=
findEntry
(
state
.
changedFiles
,
type
,
entry
.
name
);
const
foundChangedFile
=
findEntry
(
state
.
changedFiles
,
type
,
entry
.
name
);
if
(
foundChangedFile
File
)
{
return
foundChangedFile
File
;
if
(
foundChangedFile
)
{
return
foundChangedFile
;
}
}
...
...
spec/javascripts/repo/stores/actions/tree_spec.js
View file @
90b9d07f
...
...
@@ -370,5 +370,61 @@ describe('Multi-file store tree actions', () => {
done
();
}).
catch
(
done
.
fail
);
});
it
(
'
adds changed state of an already existing file
'
,
(
done
)
=>
{
const
f
=
file
(
'
changedFile
'
);
const
tree
=
{
tree
:
[],
};
const
data
=
{
trees
:
[{
name
:
'
tree
'
}],
submodules
:
[{
name
:
'
submodule
'
}],
blobs
:
[
f
],
};
store
.
state
.
changedFiles
.
push
({
...
f
,
type
:
'
blob
'
,
changed
:
true
,
});
store
.
dispatch
(
'
updateDirectoryData
'
,
{
data
,
tree
,
clearTree
:
false
,
}).
then
(()
=>
{
expect
(
tree
.
tree
[
2
].
changed
).
toBeTruthy
();
done
();
}).
catch
(
done
.
fail
);
});
it
(
'
adds opened state of an already existing file
'
,
(
done
)
=>
{
const
f
=
file
(
'
openedFile
'
);
const
tree
=
{
tree
:
[],
};
const
data
=
{
trees
:
[{
name
:
'
tree
'
}],
submodules
:
[{
name
:
'
submodule
'
}],
blobs
:
[
f
],
};
store
.
state
.
openFiles
.
push
({
...
f
,
type
:
'
blob
'
,
opened
:
true
,
});
store
.
dispatch
(
'
updateDirectoryData
'
,
{
data
,
tree
,
clearTree
:
false
,
}).
then
(()
=>
{
expect
(
tree
.
tree
[
2
].
opened
).
toBeTruthy
();
done
();
}).
catch
(
done
.
fail
);
});
});
});
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