Commit b4ac45fa authored by Robert Knight's avatar Robert Knight

Remove unnecessary mocking

This mocking broke after the ES module conversion. Since the mocked
module just exports a set of constants, we can just avoid mocking it.
parent b4754e3b
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { createElement } from 'preact'; import { createElement } from 'preact';
import bridgeEvents from '../../../shared/bridge-events';
import UserMenu from '../user-menu'; import UserMenu from '../user-menu';
import { $imports } from '../user-menu'; import { $imports } from '../user-menu';
...@@ -11,7 +12,6 @@ describe('UserMenu', () => { ...@@ -11,7 +12,6 @@ describe('UserMenu', () => {
let fakeBridge; let fakeBridge;
let fakeIsThirdPartyUser; let fakeIsThirdPartyUser;
let fakeOnLogout; let fakeOnLogout;
let fakeProfileBridgeEvent;
let fakeServiceConfig; let fakeServiceConfig;
let fakeServiceUrl; let fakeServiceUrl;
let fakeSettings; let fakeSettings;
...@@ -44,7 +44,6 @@ describe('UserMenu', () => { ...@@ -44,7 +44,6 @@ describe('UserMenu', () => {
fakeBridge = { call: sinon.stub() }; fakeBridge = { call: sinon.stub() };
fakeIsThirdPartyUser = sinon.stub(); fakeIsThirdPartyUser = sinon.stub();
fakeOnLogout = sinon.stub(); fakeOnLogout = sinon.stub();
fakeProfileBridgeEvent = 'profile-requested';
fakeServiceConfig = sinon.stub(); fakeServiceConfig = sinon.stub();
fakeServiceUrl = sinon.stub(); fakeServiceUrl = sinon.stub();
fakeSettings = { fakeSettings = {
...@@ -57,9 +56,6 @@ describe('UserMenu', () => { ...@@ -57,9 +56,6 @@ describe('UserMenu', () => {
isThirdPartyUser: fakeIsThirdPartyUser, isThirdPartyUser: fakeIsThirdPartyUser,
}, },
'../service-config': fakeServiceConfig, '../service-config': fakeServiceConfig,
'../../shared/bridge-events': {
PROFILE_REQUESTED: fakeProfileBridgeEvent,
},
}); });
}); });
...@@ -149,7 +145,7 @@ describe('UserMenu', () => { ...@@ -149,7 +145,7 @@ describe('UserMenu', () => {
onProfileSelected(); onProfileSelected();
assert.equal(fakeBridge.call.callCount, 1); assert.equal(fakeBridge.call.callCount, 1);
assert.calledWith(fakeBridge.call, fakeProfileBridgeEvent); assert.calledWith(fakeBridge.call, bridgeEvents.PROFILE_REQUESTED);
}); });
it('should not fire profile event for first-party user', () => { it('should not fire profile event for first-party user', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment