forked from matrix/element-web
Convert away from `Promise.defer`
`Promise.defer` is deprecated in Bluebird and it logs loudly each time it's called. This cleans up testing logs significantly by converting away from it.
This commit is contained in:
parent
7ac117f964
commit
f321aba4ac
|
@ -123,9 +123,6 @@ describe('loading:', function() {
|
|||
toString: function() { return this.search + this.hash; },
|
||||
};
|
||||
|
||||
const tokenLoginCompleteDefer = Promise.defer();
|
||||
tokenLoginCompletePromise = tokenLoginCompleteDefer.promise;
|
||||
|
||||
function onNewScreen(screen) {
|
||||
console.log(Date.now() + " newscreen "+screen);
|
||||
const hash = '#/' + screen;
|
||||
|
@ -157,6 +154,8 @@ describe('loading:', function() {
|
|||
PlatformPeg.set(new WebPlatform());
|
||||
|
||||
const params = parseQs(windowLocation);
|
||||
|
||||
tokenLoginCompletePromise = new Promise(resolve => {
|
||||
matrixChat = ReactDOM.render(
|
||||
<MatrixChat
|
||||
onNewScreen={onNewScreen}
|
||||
|
@ -164,11 +163,12 @@ describe('loading:', function() {
|
|||
realQueryParams={params}
|
||||
startingFragmentQueryParams={fragParts.params}
|
||||
enableGuest={true}
|
||||
onTokenLoginCompleted={() => tokenLoginCompleteDefer.resolve()}
|
||||
onTokenLoginCompleted={resolve}
|
||||
initialScreenAfterLogin={getScreenFromLocation(windowLocation)}
|
||||
makeRegistrationUrl={() => {throw new Error('Not implemented');}}
|
||||
/>, parentDiv,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// set an expectation that we will get a call to /sync, then flush
|
||||
|
|
Loading…
Reference in New Issue