Revision control
Copy as Markdown
Other Tools
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
"use strict";
const { AccountConfig } = ChromeUtils.importESModule(
);
const tabmail = document.getElementById("tabmail");
let browser;
let subview;
add_setup(async function () {
const tab = tabmail.openTab("contentTab", {
});
await BrowserTestUtils.browserLoaded(tab.browser);
tab.browser.focus();
browser = tab.browser;
subview = tab.browser.contentWindow.document.querySelector(
"email-manual-config-form"
);
EventUtils.synthesizeMouseAtCenter(subview, {}, browser.contentWindow);
registerCleanupFunction(() => {
tabmail.closeOtherTabs(tabmail.tabInfo[0]);
});
});
add_task(function test_setState() {
const state = new AccountConfig();
subview.setState(state);
// The current state of the form should be updated.
Assert.deepEqual(
subview.captureState(),
state,
"The current state should have been updated"
);
});