Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 433fc7a

Browse files
committed
Explicitly update wrapper from repository when needed
1 parent 3992aa8 commit 433fc7a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/controllers/git-tab-controller.test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,10 +613,12 @@ describe('GitTabController', function() {
613613
const commitView = wrapper.find('CommitView').instance();
614614
commitView.setState({showCoAuthorInput: true});
615615
commitView.onSelectedCoAuthorsChanged([author]);
616+
await updateWrapper(repository, wrapper);
616617

617618
commandRegistry.dispatch(workspaceElement, 'github:amend-last-commit');
618619
// verify that coAuthor was passed
619620
await assert.async.deepEqual(repository.commit.args[0][1], {amend: true, coAuthors: [author]});
621+
await repository.commit.returnValues[0];
620622
await updateWrapper(repository, wrapper);
621623

622624
assert.deepEqual(getLastCommit().coAuthors, [author]);
@@ -706,15 +708,14 @@ describe('GitTabController', function() {
706708
const wrapper = mount(await buildApp(repository));
707709

708710
assert.deepEqual(wrapper.find('CommitView').prop('selectedCoAuthors'), []);
711+
// ensure that the co author trailer is stripped from commit message
712+
let commitMessages = wrapper.find('.github-RecentCommit-message').map(node => node.text());
713+
assert.deepEqual(commitMessages, [commitSubject, 'Initial commit']);
709714

710715
assert.lengthOf(wrapper.find('.github-RecentCommit-undoButton'), 1);
711716
wrapper.find('.github-RecentCommit-undoButton').simulate('click');
712717
await updateWrapper(repository, wrapper);
713718

714-
let commitMessages = wrapper.find('.github-RecentCommit-message').map(node => node.text());
715-
// ensure that the co author trailer is stripped from commit message
716-
assert.deepEqual(commitMessages, [commitSubject, 'Initial commit']);
717-
718719
assert.lengthOf(wrapper.find('GitTabView').prop('stagedChanges'), 1);
719720
assert.deepEqual(wrapper.find('GitTabView').prop('stagedChanges'), [{
720721
filePath: 'new-file.txt',

0 commit comments

Comments
 (0)