Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion lib/views/issueish-timeline-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import CommitCommentThreadView from './timeline-items/commit-comment-thread-view

export function collectionRenderer(Component, styleAsTimelineItem = true) {
return class GroupedComponent extends React.Component {
static displayName = `Grouped(${Component.displayName})`
static displayName = `Grouped(${Component.render ? Component.render.displayName : Component.displayName})`

static propTypes = {
nodes: PropTypes.array.isRequired,
Expand Down
335 changes: 176 additions & 159 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"atom-babel6-transpiler": "1.2.0",
"babel-generator": "6.26.1",
"babel-plugin-chai-assert-async": "0.1.0",
"babel-plugin-relay": "1.6.0",
"babel-plugin-relay": "1.7.0",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-es2015-modules-commonjs": "6.26.2",
"babel-plugin-transform-object-rest-spread": "6.26.0",
Expand All @@ -61,10 +61,10 @@
"prop-types": "15.6.2",
"react": "16.7.0",
"react-dom": "16.7.0",
"react-relay": "1.6.0",
"react-relay": "1.7.0",
"react-select": "1.2.1",
"react-tabs": "^3.0.0",
"relay-runtime": "1.6.0",
"relay-runtime": "1.7.0",
"temp": "0.9.0",
"tinycolor2": "1.4.1",
"tree-kill": "1.2.1",
Expand Down
30 changes: 15 additions & 15 deletions test/controllers/issueish-detail-controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,37 +105,37 @@ describe('IssueishDetailController', function() {
});
it('is disabled if the repository is loading or absent', function() {
const wrapper = shallow(buildApp({}, {isAbsent: true}));
const op = wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp');
const op = wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp');
assert.isFalse(op.isEnabled());
assert.strictEqual(op.getMessage(), 'No repository found');

wrapper.setProps({isAbsent: false, isLoading: true});
const op1 = wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp');
const op1 = wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp');
assert.isFalse(op1.isEnabled());
assert.strictEqual(op1.getMessage(), 'Loading');

wrapper.setProps({isAbsent: false, isLoading: false, isPresent: false});
const op2 = wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp');
const op2 = wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp');
assert.isFalse(op2.isEnabled());
assert.strictEqual(op2.getMessage(), 'No repository found');
});

it('is disabled if the local repository is merging or rebasing', function() {
const wrapper = shallow(buildApp({}, {isMerging: true}));
const op0 = wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp');
const op0 = wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp');
assert.isFalse(op0.isEnabled());
assert.strictEqual(op0.getMessage(), 'Merge in progress');

wrapper.setProps({isMerging: false, isRebasing: true});
const op1 = wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp');
const op1 = wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp');
assert.isFalse(op1.isEnabled());
assert.strictEqual(op1.getMessage(), 'Rebase in progress');
});
it('is disabled if pullRequest.headRepository is null', function() {
const props = issueishDetailControllerProps({}, {});
props.repository.pullRequest.headRepository = null;
const wrapper = shallow(buildApp({}, {...props}));
const op = wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp');
const op = wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp');
assert.isFalse(op.isEnabled());
assert.strictEqual(op.getMessage(), 'Pull request head repository does not exist');
});
Expand All @@ -159,7 +159,7 @@ describe('IssueishDetailController', function() {
remotes,
}));

const op = wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp');
const op = wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp');
assert.isFalse(op.isEnabled());
assert.strictEqual(op.getMessage(), 'Current');
});
Expand All @@ -185,7 +185,7 @@ describe('IssueishDetailController', function() {
remotes,
}));

const op = wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp');
const op = wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp');
assert.isFalse(op.isEnabled());
assert.strictEqual(op.getMessage(), 'Current');
});
Expand Down Expand Up @@ -217,7 +217,7 @@ describe('IssueishDetailController', function() {
}));

sinon.spy(reporterProxy, 'incrementCounter');
await wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp').run();
await wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp').run();

assert.isTrue(addRemote.calledWith('ccc', '[email protected]:ccc/ddd.git'));
assert.isTrue(fetch.calledWith('refs/heads/feature', {remoteName: 'ccc'}));
Expand Down Expand Up @@ -255,7 +255,7 @@ describe('IssueishDetailController', function() {
}));

sinon.spy(reporterProxy, 'incrementCounter');
await wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp').run();
await wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp').run();

assert.isTrue(fetch.calledWith('refs/heads/clever-name', {remoteName: 'existing'}));
assert.isTrue(checkout.calledWith('pr-789/ccc/clever-name', {
Expand Down Expand Up @@ -298,7 +298,7 @@ describe('IssueishDetailController', function() {
}));

sinon.spy(reporterProxy, 'incrementCounter');
await wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp').run();
await wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp').run();

assert.isTrue(checkout.calledWith('existing'));
assert.isTrue(pull.calledWith('refs/heads/yes', {remoteName: 'upstream', ffOnly: true}));
Expand All @@ -310,7 +310,7 @@ describe('IssueishDetailController', function() {
const wrapper = shallow(buildApp({}, {addRemote}));

// Should not throw
await wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp').run();
await wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp').run();
assert.isTrue(addRemote.called);
});

Expand All @@ -319,7 +319,7 @@ describe('IssueishDetailController', function() {
const wrapper = shallow(buildApp({}, {addRemote}));

await assert.isRejected(
wrapper.find('Relay(BarePullRequestDetailView)').prop('checkoutOp').run(),
wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('checkoutOp').run(),
/not handled by the pipeline/,
);
assert.isTrue(addRemote.called);
Expand All @@ -329,7 +329,7 @@ describe('IssueishDetailController', function() {
describe('openCommit', function() {
it('opens a CommitDetailItem in the workspace', async function() {
const wrapper = shallow(buildApp({}, {workdirPath: __dirname}));
await wrapper.find('Relay(BarePullRequestDetailView)').prop('openCommit')({sha: '1234'});
await wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('openCommit')({sha: '1234'});

assert.include(
atomEnv.workspace.getPaneItems().map(item => item.getURI()),
Expand All @@ -341,7 +341,7 @@ describe('IssueishDetailController', function() {
sinon.stub(reporterProxy, 'addEvent');

const wrapper = shallow(buildApp({}, {workdirPath: __dirname}));
await wrapper.find('Relay(BarePullRequestDetailView)').prop('openCommit')({sha: '1234'});
await wrapper.find('ForwardRef(Relay(BarePullRequestDetailView))').prop('openCommit')({sha: '1234'});

assert.isTrue(
reporterProxy.addEvent.calledWith(
Expand Down
6 changes: 3 additions & 3 deletions test/views/issue-detail-view.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('IssueDetailView', function() {
assert.strictEqual(link.text(), 'user1/repo#200');
assert.strictEqual(link.prop('href'), 'https://github.com/user1/repo/issues/200');

assert.isFalse(wrapper.find('Relay(PrStatuses)').exists());
assert.isFalse(wrapper.find('ForwardRef(Relay(PrStatuses))').exists());
assert.isFalse(wrapper.find('.github-IssueishDetailView-checkoutButton').exists());

const avatarLink = wrapper.find('.github-IssueishDetailView-avatar');
Expand All @@ -49,8 +49,8 @@ describe('IssueDetailView', function() {

assert.lengthOf(wrapper.find(EmojiReactionsView), 1);

assert.isNotNull(wrapper.find('Relay(IssueishTimelineView)').prop('issue'));
assert.notOk(wrapper.find('Relay(IssueishTimelineView)').prop('pullRequest'));
assert.isNotNull(wrapper.find('ForwardRef(Relay(IssueishTimelineView))').prop('issue'));
assert.notOk(wrapper.find('ForwardRef(Relay(IssueishTimelineView))').prop('pullRequest'));
});

it('renders a placeholder issue body', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/views/issueish-timeline-view.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('IssueishTimelineView', function() {
],
}));

const commitGroup0 = wrapper.find('Relay(BareCommitsView)').filterWhere(c => c.prop('nodes').length === 2);
const commitGroup0 = wrapper.find('ForwardRef(Relay(BareCommitsView))').filterWhere(c => c.prop('nodes').length === 2);
assert.deepEqual(commitGroup0.prop('nodes').map(n => n.id), [0, 1]);

const commentGroup0 = wrapper.find('Grouped(Relay(BareIssueCommentView))').filterWhere(c => c.prop('nodes').length === 1);
Expand All @@ -80,7 +80,7 @@ describe('IssueishTimelineView', function() {
const mergedGroup = wrapper.find('Grouped(Relay(BareMergedEventView))').filterWhere(c => c.prop('nodes').length === 1);
assert.deepEqual(mergedGroup.prop('nodes').map(n => n.id), [3]);

const commitGroup1 = wrapper.find('Relay(BareCommitsView)').filterWhere(c => c.prop('nodes').length === 4);
const commitGroup1 = wrapper.find('ForwardRef(Relay(BareCommitsView))').filterWhere(c => c.prop('nodes').length === 4);
assert.deepEqual(commitGroup1.prop('nodes').map(n => n.id), [4, 5, 6, 7]);

const commentGroup1 = wrapper.find('Grouped(Relay(BareIssueCommentView))').filterWhere(c => c.prop('nodes').length === 2);
Expand Down
29 changes: 15 additions & 14 deletions test/views/pr-detail-view.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('PullRequestDetailView', function() {

assert.isTrue(wrapper.find('.github-IssueishDetailView-checkoutButton').exists());

assert.isDefined(wrapper.find('Relay(BarePrStatusesView)[displayType="check"]').prop('pullRequest'));
assert.isDefined(wrapper.find('ForwardRef(Relay(BarePrStatusesView))[displayType="check"]').prop('pullRequest'));

const avatarLink = wrapper.find('.github-IssueishDetailView-avatar');
assert.strictEqual(avatarLink.prop('href'), 'https://github.com/author0');
Expand All @@ -56,9 +56,9 @@ describe('PullRequestDetailView', function() {

assert.lengthOf(wrapper.find(EmojiReactionsView), 1);

assert.notOk(wrapper.find('Relay(IssueishTimelineView)').prop('issue'));
assert.isNotNull(wrapper.find('Relay(IssueishTimelineView)').prop('pullRequest'));
assert.isNotNull(wrapper.find('Relay(BarePrStatusesView)[displayType="full"]').prop('pullRequest'));
assert.notOk(wrapper.find('ForwardRef(Relay(IssueishTimelineView))').prop('issue'));
assert.isNotNull(wrapper.find('ForwardRef(Relay(IssueishTimelineView))').prop('pullRequest'));
assert.isNotNull(wrapper.find('ForwardRef(Relay(BarePrStatusesView))[displayType="full"]').prop('pullRequest'));

assert.strictEqual(wrapper.find('.github-IssueishDetailView-baseRefName').text(), baseRefName);
assert.strictEqual(wrapper.find('.github-IssueishDetailView-headRefName').text(), headRefName);
Expand Down Expand Up @@ -104,28 +104,29 @@ describe('PullRequestDetailView', function() {
checkoutOp: new EnableableOperation(() => {}).disable(checkoutStates.CURRENT),
}));

assert.isTrue(wrapper.find('Relay(IssueishTimelineView)').prop('onBranch'));
assert.isTrue(wrapper.find('Relay(PrCommitsView)').prop('onBranch'));
assert.isTrue(wrapper.find('ForwardRef(Relay(IssueishTimelineView))').prop('onBranch'));
assert.isTrue(wrapper.find('ForwardRef(Relay(IssueishTimelineView))').prop('onBranch'));
assert.isTrue(wrapper.find('ForwardRef(Relay(PrCommitsView))').prop('onBranch'));
});

it('tells its tabs when the pull request is not checked out', function() {
const checkoutOp = new EnableableOperation(() => {});

const wrapper = shallow(buildApp({}, {checkoutOp}));
assert.isFalse(wrapper.find('Relay(IssueishTimelineView)').prop('onBranch'));
assert.isFalse(wrapper.find('Relay(PrCommitsView)').prop('onBranch'));
assert.isFalse(wrapper.find('ForwardRef(Relay(IssueishTimelineView))').prop('onBranch'));
assert.isFalse(wrapper.find('ForwardRef(Relay(PrCommitsView))').prop('onBranch'));

wrapper.setProps({checkoutOp: checkoutOp.disable(checkoutStates.HIDDEN, 'message')});
assert.isFalse(wrapper.find('Relay(IssueishTimelineView)').prop('onBranch'));
assert.isFalse(wrapper.find('Relay(PrCommitsView)').prop('onBranch'));
assert.isFalse(wrapper.find('ForwardRef(Relay(IssueishTimelineView))').prop('onBranch'));
assert.isFalse(wrapper.find('ForwardRef(Relay(PrCommitsView))').prop('onBranch'));

wrapper.setProps({checkoutOp: checkoutOp.disable(checkoutStates.DISABLED, 'message')});
assert.isFalse(wrapper.find('Relay(IssueishTimelineView)').prop('onBranch'));
assert.isFalse(wrapper.find('Relay(PrCommitsView)').prop('onBranch'));
assert.isFalse(wrapper.find('ForwardRef(Relay(IssueishTimelineView))').prop('onBranch'));
assert.isFalse(wrapper.find('ForwardRef(Relay(PrCommitsView))').prop('onBranch'));

wrapper.setProps({checkoutOp: checkoutOp.disable(checkoutStates.BUSY, 'message')});
assert.isFalse(wrapper.find('Relay(IssueishTimelineView)').prop('onBranch'));
assert.isFalse(wrapper.find('Relay(PrCommitsView)').prop('onBranch'));
assert.isFalse(wrapper.find('ForwardRef(Relay(IssueishTimelineView))').prop('onBranch'));
assert.isFalse(wrapper.find('ForwardRef(Relay(PrCommitsView))').prop('onBranch'));
});

it('renders pull request information for cross repository PR', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/views/pr-statuses-view.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe('PrStatusesView', function() {
it('renders a context view for each status context', function() {
const wrapper = shallow(buildApp({summaryState: 'FAILURE', states: ['SUCCESS', 'FAILURE', 'ERROR']}));

const contextViews = wrapper.find('Relay(BarePrStatusContextView)');
const contextViews = wrapper.find('ForwardRef(Relay(BarePrStatusContextView))');
assert.deepEqual(contextViews.map(v => v.prop('context').state), ['SUCCESS', 'FAILURE', 'ERROR']);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('CommitCommentThreadView', function() {
],
}));

const commentViews = wrapper.find('Relay(BareCommitCommentView)');
const commentViews = wrapper.find('ForwardRef(Relay(BareCommitCommentView))');

assert.deepEqual(commentViews.map(c => c.prop('item').author.login), ['user0', 'user1', 'user2']);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('CrossReferencedEventsView', function() {

it('renders a child component for each grouped child event', function() {
const wrapper = shallow(buildApp({nodeOpts: [{}, {}, {}]}));
assert.lengthOf(wrapper.find('Relay(BareCrossReferencedEventView)'), 3);
assert.lengthOf(wrapper.find('ForwardRef(Relay(BareCrossReferencedEventView))'), 3);
});

it('generates a summary based on a single pull request cross-reference', function() {
Expand Down