Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
109af34
Add "New User" as first item in co-author suggestion list
kuychaco Apr 2, 2018
b4a6959
Implement CoAuthorDialog and allow users to add new authors
kuychaco Apr 2, 2018
59a101e
Add test for adding a co author in git tab controller.
Apr 3, 2018
c61545a
Make NewCoAuthor dialog a bit more compact
simurai Apr 3, 2018
3017242
Refactor class names
simurai Apr 3, 2018
4fdacff
Add validation for co author email.
Apr 3, 2018
39d37f8
Make buttons flexible.
simurai Apr 4, 2018
74fbbcd
Ensure `New Author` is always present in list even when filtering.
Apr 4, 2018
5a555c8
Propagate input from co author list to create new co author dialog.
Apr 4, 2018
2a19b8e
:fire: .only
kuychaco Apr 4, 2018
3a6c1a3
Use consistent wording for "New Author" and extract NEW_AUTHOR constant
kuychaco Apr 4, 2018
91ee708
:fire: unnecessary `@autobind`
kuychaco Apr 4, 2018
b0161a9
:fire: unnecessary check to see if message param to GSOS#commit is a …
kuychaco Apr 4, 2018
27026e8
Italicize "New Author" item in co-author suggestion list
kuychaco Apr 4, 2018
8945ed6
Update "add new author" item in list to reflect what user has typed
kuychaco Apr 4, 2018
120d4db
Clear the selected co-authors when toggling the input closed
kuychaco Apr 4, 2018
f50d782
Change co-author toggle icon tooltip text to say Add/Remove co-authors
kuychaco Apr 4, 2018
1f6c374
:fire: test that never actually tested the thing
kuychaco Apr 4, 2018
e6a7eaf
Add ability to get user name and email from git.
Apr 4, 2018
75fd96d
WIP - filtering committer from list of co authors.
Apr 5, 2018
3d2defb
Exclude `noreply@github.com` from the list of co-authors.
Apr 6, 2018
77f1e7c
Fix caching issues with getCommitter
Apr 6, 2018
891ffbb
Add border around coauthor input box to distinguish it from background.
Apr 6, 2018
01680a0
Make toggle icons in commit box hover with hand (cursor: pointer)
Apr 6, 2018
445d2f3
Make co-author icon brighter color to indicate "active" state.
Apr 6, 2018
1682074
Whe `esc` key is pressed in co author input, close email suggestion list
Apr 6, 2018
ccb67b8
Focus co-author input field when first opened
kuychaco Apr 7, 2018
4816d55
Add co-author input to list of focus elements in commit view
kuychaco Apr 7, 2018
4f3ac9f
Focus co-author input list after new author dialog is closed
kuychaco Apr 7, 2018
25be234
Add new co-author on `enter`
kuychaco Apr 7, 2018
d5af769
Don't focus commit editor when `tab`bing from co-author input
kuychaco Apr 7, 2018
dc7345f
Allow `tab`bing from co-author input to abort merge and commit button
kuychaco Apr 7, 2018
c5427d2
Submit new co-author input only if valid
kuychaco Apr 7, 2018
bde0c32
Only shift-tab to the StagingView if the commit editor is focused
kuychaco Apr 7, 2018
c2c5d60
Add tooltip for `cmd/ctrl-enter` to commit. Remove `tab` to focus button
kuychaco Apr 7, 2018
92e3bc4
Rename CommitView#hasEditorFocus => CommitView#hasFocusEditor
kuychaco Apr 8, 2018
fbae7c1
Fix broken GitTabController focus tests
kuychaco Apr 8, 2018
0ee35a9
Don't filter selected authors from list based on referential identity
kuychaco Apr 9, 2018
9570ae4
Fix flakey UserStore test
kuychaco Apr 9, 2018
8bc2f37
Rename CoAuthorDialog -> CoAuthorForm
kuychaco Apr 9, 2018
b9a454d
:art: and clean up
kuychaco Apr 9, 2018
bdd4261
Drop `github-coAuthor-select-input` and rely on existing classname
kuychaco Apr 9, 2018
0edca73
Add some clarifying comments
kuychaco Apr 10, 2018
56a1903
:shirt:
kuychaco Apr 10, 2018
dab0f03
clarify svg title for add/remove co authors button
Apr 10, 2018
d428edd
Disable `no-param-reassign` eslint rule
kuychaco Apr 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions test/models/user-store.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,23 @@ describe('UserStore', function() {
const workdirPath = await cloneRepository('multiple-commits');
const repository = await buildRepository(workdirPath);
const store = new UserStore({repository});
sinon.spy(store, 'addUsers');
await store.loadUsersFromLocalRepo();

store.addUsers.reset();
sinon.spy(store, 'addUsers');
// make a commit with FAKE_USER as committer
await repository.commit('made a new commit', {allowEmpty: true});
await assert.async.equal(store.addUsers.callCount, 1);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you help me understand what the issue was?

@annthurium totally! We were getting a second addUsers call from the setup when we instantiated a UserStore. Awaiting loadUsersFromLocalRepo ensures that we don't start spying until that first addUsers call is complete from the initial load. That way we're only listening for the addUsers call associated with our commit action.


// todo: this assertion is not consistently passing :-( fix it.
// await assert.async.equal(store.addUsers.callCount, 1);

// verify that FAKE_USER is in commit history
const lastCommit = await repository.getLastCommit();
assert.strictEqual(lastCommit.getAuthorEmail(), FAKE_USER.email);

// verify that FAKE_USER is not in users returned from `getUsers`
const users = store.getUsers();
const committerFromStore = users.find(user => user.email === FAKE_USER.email);
assert.isUndefined(committerFromStore);

// verify that no-reply email address is not in users array
const noReplyUser = users.find(user => user.email === NO_REPLY_GITHUB_EMAIL);
assert.isUndefined(noReplyUser);
});
Expand Down