This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace remoteOperationObserver with a Refresher
- Loading branch information
1 parent
ac0db9c
commit be9284c
Showing
16 changed files
with
41 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ import {shallow} from 'enzyme'; | |
import {QueryRenderer} from 'react-relay'; | ||
|
||
import CurrentPullRequestContainer from '../../lib/containers/current-pull-request-container'; | ||
import {ManualStateObserver} from '../helpers'; | ||
import {queryBuilder} from '../builder/graphql/query'; | ||
import Remote from '../../lib/models/remote'; | ||
import RemoteSet from '../../lib/models/remote-set'; | ||
|
@@ -15,12 +14,6 @@ import repositoryQuery from '../../lib/containers/__generated__/remoteContainerQ | |
import currentQuery from '../../lib/containers/__generated__/currentPullRequestContainerQuery.graphql.js'; | ||
|
||
describe('CurrentPullRequestContainer', function() { | ||
let observer; | ||
|
||
beforeEach(function() { | ||
observer = new ManualStateObserver(); | ||
}); | ||
|
||
function buildApp(overrideProps = {}) { | ||
const origin = new Remote('origin', '[email protected]:atom/github.git'); | ||
const upstreamBranch = Branch.createRemoteTracking('refs/remotes/origin/master', 'origin', 'refs/heads/master'); | ||
|
@@ -37,7 +30,6 @@ describe('CurrentPullRequestContainer', function() { | |
|
||
token="1234" | ||
endpoint={origin.getEndpoint()} | ||
remoteOperationObserver={observer} | ||
remote={origin} | ||
remotes={remotes} | ||
branches={branches} | ||
|
@@ -209,15 +201,4 @@ describe('CurrentPullRequestContainer', function() { | |
assert.isTrue(filterFn({getHeadRepositoryID: () => '100'})); | ||
assert.isFalse(filterFn({getHeadRepositoryID: () => '12'})); | ||
}); | ||
|
||
it('performs the query again when a remote operation completes', function() { | ||
const wrapper = shallow(buildApp()); | ||
|
||
const props = queryBuilder(currentQuery).build(); | ||
const retry = sinon.spy(); | ||
wrapper.find(QueryRenderer).renderProp('render')({error: null, props, retry}); | ||
|
||
observer.trigger(); | ||
assert.isTrue(retry.called); | ||
}); | ||
}); |
Oops, something went wrong.