updated testing setup to understand my api calls

This commit is contained in:
Kendall Werts 2019-10-24 16:42:19 -05:00
parent 328c926ddf
commit c29c0694fb
2 changed files with 14 additions and 2 deletions

View file

@ -245,7 +245,7 @@ const assignManager = {
}, },
async getPermissions() { async getPermissions() {
const {permissions} = await browser.permissions.getAll() const {permissions} = await browser.permissions.getAll();
permissions.includes("bookmarks") ? this.makeBookmarksMenu() : browser.contextMenus.remove(this.OPEN_IN_CONTAINER); permissions.includes("bookmarks") ? this.makeBookmarksMenu() : browser.contextMenus.remove(this.OPEN_IN_CONTAINER);
}, },

View file

@ -58,7 +58,16 @@ module.exports = () => {
contextualIdentities: { contextualIdentities: {
create: sinon.stub(), create: sinon.stub(),
get: sinon.stub(), get: sinon.stub(),
query: sinon.stub().resolves([]) query: sinon.stub().resolves([]),
onCreated: {
addListener: sinon.stub()
},
onUpdated: {
addListener: sinon.stub()
},
onRemoved: {
addListener: sinon.stub()
}
}, },
contextMenus: { contextMenus: {
create: sinon.stub(), create: sinon.stub(),
@ -82,6 +91,9 @@ module.exports = () => {
}, },
extension: { extension: {
getURL: sinon.stub().returns("moz-extension://multi-account-containers/confirm-page.html") getURL: sinon.stub().returns("moz-extension://multi-account-containers/confirm-page.html")
},
permissions: {
getAll: sinon.stub().returns({"permissions": ["bookmarks"]})
} }
}; };