Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit cc41994

Browse files
committed
Bind the active repository to the openPublishDialog call
1 parent 2a50b9f commit cc41994

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/controllers/github-tab-controller.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default class GitHubTabController extends React.Component {
6868
getCurrentWorkDirs={this.props.getCurrentWorkDirs}
6969
onDidChangeWorkDirs={this.props.onDidChangeWorkDirs}
7070
openCreateDialog={this.props.openCreateDialog}
71-
openPublishDialog={this.props.openPublishDialog}
71+
openBoundPublishDialog={this.openBoundPublishDialog}
7272
openCloneDialog={this.props.openCloneDialog}
7373
openGitTab={this.props.openGitTab}
7474
/>
@@ -86,4 +86,6 @@ export default class GitHubTabController extends React.Component {
8686
e.preventDefault();
8787
return this.props.repository.setConfig('atomGithub.currentRemote', remote.getName());
8888
}
89+
90+
openBoundPublishDialog = () => this.props.openPublishDialog(this.props.repository);
8991
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ describe('GitHubTabController', function() {
127127

128128
assert.isTrue(event.preventDefault.called);
129129
assert.isTrue(repository.setConfig.calledWith('atomGithub.currentRemote', 'aaa'));
130+
131+
it('opens the publish dialog on the active repository', async function() {
132+
const someRepo = await buildRepository(await cloneRepository());
133+
const openPublishDialog = sinon.spy();
134+
const wrapper = shallow(buildApp({repository: someRepo, openPublishDialog}));
135+
136+
wrapper.find('GitHubTabView').prop('openBoundPublishDialog')();
137+
assert.isTrue(openPublishDialog.calledWith(someRepo));
130138
});
131139
});
132140
});

0 commit comments

Comments
 (0)