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

Commit cd28dd5

Browse files
committed
GithubTabView tests
1 parent 8b5aa61 commit cd28dd5

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

lib/views/github-tab-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class GitHubTabView extends React.Component {
4242
aheadCount: PropTypes.number,
4343
pushInProgress: PropTypes.bool.isRequired,
4444

45-
// Event Handelrs
45+
// Event Handlers
4646
handleWorkDirSelect: PropTypes.func,
4747
handlePushBranch: PropTypes.func.isRequired,
4848
handleRemoteSelect: PropTypes.func.isRequired,

test/views/github-tab-view.test.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,31 @@ describe('GitHubTabView', function() {
3131

3232
return (
3333
<GitHubTabView
34-
workspace={atomEnv.workspace}
3534
refresher={new Refresher()}
36-
loginModel={new GithubLoginModel(InMemoryStrategy)}
3735
rootHolder={new RefHolder()}
3836

37+
loginModel={new GithubLoginModel(InMemoryStrategy)}
38+
39+
workspace={atomEnv.workspace}
3940
workingDirectory={repo.getWorkingDirectoryPath()}
41+
getCurrentWorkDirs={() => []}
42+
changeWorkingDirectory={() => {}}
43+
contextLocked={false}
44+
setContextLock={() => {}}
4045
repository={repo}
41-
branches={new BranchSet()}
42-
currentBranch={nullBranch}
46+
4347
remotes={new RemoteSet()}
4448
currentRemote={nullRemote}
4549
manyRemotesAvailable={false}
46-
pushInProgress={false}
4750
isLoading={false}
51+
branches={new BranchSet()}
52+
currentBranch={nullBranch}
53+
pushInProgress={false}
4854

55+
handleWorkDirSelect={() => {}}
4956
handlePushBranch={() => {}}
5057
handleRemoteSelect={() => {}}
51-
changeWorkingDirectory={() => {}}
5258
onDidChangeWorkDirs={() => {}}
53-
getCurrentWorkDirs={() => []}
5459
openCreateDialog={() => {}}
5560
openBoundPublishDialog={() => {}}
5661
openCloneDialog={() => {}}
@@ -125,7 +130,7 @@ describe('GitHubTabView', function() {
125130
const currentRemote = new Remote('aaa', '[email protected]:aaa/bbb.git');
126131
const changeWorkingDirectory = sinon.spy();
127132
const wrapper = shallow(buildApp({currentRemote, changeWorkingDirectory}));
128-
wrapper.find('GithubTabHeaderContainer').prop('handleWorkDirSelect')({target: {value: 'some-path'}});
133+
wrapper.find('GithubTabHeaderContainer').prop('changeWorkingDirectory')('some-path');
129134
assert.isTrue(changeWorkingDirectory.calledWith('some-path'));
130135
});
131136
});

0 commit comments

Comments
 (0)