summaryrefslogtreecommitdiffstats
path: root/browser/components/migration/tests/chrome/test_migration_wizard.html
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/migration/tests/chrome/test_migration_wizard.html')
-rw-r--r--browser/components/migration/tests/chrome/test_migration_wizard.html254
1 files changed, 254 insertions, 0 deletions
diff --git a/browser/components/migration/tests/chrome/test_migration_wizard.html b/browser/components/migration/tests/chrome/test_migration_wizard.html
index d991cce114..cc2d8a0363 100644
--- a/browser/components/migration/tests/chrome/test_migration_wizard.html
+++ b/browser/components/migration/tests/chrome/test_migration_wizard.html
@@ -725,6 +725,10 @@
EXTENSIONS_INFO_HREF
);
is(
+ extensionsGroup.querySelector("a.message-text").target,
+ "_blank"
+ );
+ is(
extensionsGroup.querySelector(".support-text").textContent,
EXTENSIONS_SUPPORT_STRING
);
@@ -732,6 +736,10 @@
extensionsGroup.querySelector(".support-text").href,
EXTENSIONS_SUPPORT_HREF
);
+ is(
+ extensionsGroup.querySelector(".support-text").target,
+ "_blank"
+ );
// With progress being complete, the header should be using the completed
// migration string.
@@ -792,6 +800,10 @@
extensionsGroup.querySelector(".support-text").href,
EXTENSIONS_SUPPORT_HREF
);
+ is(
+ extensionsGroup.querySelector(".support-text").target,
+ "_blank"
+ );
// With progress being complete, the header should be using the completed
// migration string.
@@ -1521,6 +1533,248 @@
let getPermissionButton = gShadowRoot.querySelector("#get-permissions");
ok(isHidden(getPermissionButton), "Get permissions button hiddne.");
});
+
+ add_task(async function hide_option_expander_subtitle() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+ gWiz.setAttribute("hide-option-expander-subtitle", "true");
+ let subtitle = selectionPage.querySelector("#resource-selection-summary > .selected-data");
+
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+
+ ok(gWiz.hasAttribute("hide-option-expander-subtitle"), "hide option expander subtitle attribute is present on migration wizard");
+
+ ok(isHidden(subtitle), "subtitle is hidden");
+
+ gWiz.removeAttribute("hide-option-expander-subtitle");
+ });
+
+ add_task(async function update_option_expander_title_string() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+
+ let title = selectionPage.querySelector(".selected-data-header");
+ gWiz.setAttribute("option-expander-title-string", "test");
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+
+ await BrowserTestUtils.waitForMutationCondition(
+ title,
+ {childList: true},
+ () => title.textContent == "test"
+ )
+ is(title.textContent, "test", "resource selection expander subtitle has been changed");
+
+ gWiz.removeAttribute("option-expander-title-string");
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+
+ await BrowserTestUtils.waitForMutationCondition(
+ title,
+ {childList: true},
+ () => title.textContent != "test"
+ )
+ isnot(title.textContent, "test", "resource selection expander subtitle was reverted");
+ });
+
+ add_task(async function hide_select_all_checkbox() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+
+ let selectAll = selectionPage.querySelector("#select-all");
+ gWiz.setAttribute("hide-select-all", true);
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+
+ ok(isHidden(selectAll), "select all is not displayed");
+
+ gWiz.removeAttribute("hide-select-all");
+ });
+
+ add_task(async function update_import_button_string() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+ gWiz.setAttribute("import-button-string", "test");
+ let button = selectionPage.querySelector(".migration-import-button");
+
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+
+ is(button.textContent, "test", "button text is expected");
+
+ gWiz.removeAttribute("import-button-string");
+ });
+
+ add_task(async function update_checkbox_margins() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+
+ gWiz.setAttribute("checkbox-margin-inline", "27px 42px");
+ gWiz.setAttribute("checkbox-margin-block", "42px 27px");
+
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+
+ let checkboxLabels = selectionPage.querySelectorAll(".resource-type-label");
+ for(let label of checkboxLabels) {
+ let computedStyle = getComputedStyle(label);
+ let marginInline = computedStyle.getPropertyValue("margin-inline");
+ let marginBlock = computedStyle.getPropertyValue("margin-block");
+ is(marginInline, "27px 42px", "margin inline is set to expected value");
+ is(marginBlock, "42px 27px", "margin block is set to expected value");
+ }
+
+ gWiz.removeAttribute("checkbox-margin-inline");
+ gWiz.removeAttribute("checkbox-margin-block");
+ });
+
+ add_task(async function update_import_button_class() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+ let importButton = selectionPage.querySelector("#import");
+
+ gWiz.setAttribute("import-button-class", "primary");
+
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+
+ ok(importButton.classList.contains("primary"), "import button has the primary class");
+
+ gWiz.removeAttribute("import-button-class");
+ });
+
+ add_task(async function update_header_font_size() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+ let header = selectionPage.querySelector("h1");
+
+ gWiz.setAttribute("header-font-size", "24px");
+
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+ let computedStyle = getComputedStyle(header);
+
+ is(computedStyle.getPropertyValue("font-size"), "24px", "header font size is changed to correct value");
+ gWiz.removeAttribute("header-font-size");
+ });
+
+ add_task(async function update_header_margin_block() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+ let header = selectionPage.querySelector("h1");
+
+ gWiz.setAttribute("header-margin-block", "20px 30px");
+
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+ let computedStyle = getComputedStyle(header);
+
+ is(computedStyle.getPropertyValue("margin-block"), "20px 30px", "header margin block is changed to correct value");
+ gWiz.removeAttribute("header-margin-block");
+ });
+
+ add_task(async function update_header_string() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+ let header = selectionPage.querySelector("h1");
+
+ gWiz.setAttribute("selection-header-string", "test string");
+
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+
+ is(header.textContent, "test string", "header text content is changed to correct value");
+ gWiz.removeAttribute("selection-header-string");
+ });
+
+ add_task(async function update_subheader_font_size() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+ let subheader = selectionPage.querySelector("h1");
+
+ gWiz.setAttribute("subheader-font-size", "24px");
+
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+ let computedStyle = getComputedStyle(subheader);
+
+ is(computedStyle.getPropertyValue("font-size"), "24px", "subheader font size is changed to correct value");
+ gWiz.removeAttribute("subheader-font-size");
+ });
+
+ add_task(async function update_subheader_margin_block() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+ let subheader = selectionPage.querySelector("h1");
+
+ gWiz.setAttribute("subheader-margin-block", "20px 30px");
+
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+ let computedStyle = getComputedStyle(subheader);
+
+ is(computedStyle.getPropertyValue("margin-block"), "20px 30px", "subheader margin block is changed to correct value");
+ gWiz.removeAttribute("subheader-margin-block");
+ });
+
+ add_task(async function update_subheader_string() {
+ let selectionPage = gShadowRoot.querySelector("div[name='page-selection']");
+ let subheader = selectionPage.querySelector(".migration-wizard-subheader");
+
+ gWiz.setAttribute("selection-subheader-string", "test string");
+
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+
+ is(subheader.textContent, "test string", "subheader text content is changed to correct value");
+
+ gWiz.removeAttribute("selection-subheader-string");
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.SELECTION,
+ migrators: MIGRATOR_PROFILE_INSTANCES,
+ });
+
+ ok(isHidden(subheader), "subheader is hidden")
+ });
+
+ add_task(async function update_data_import_success_string() {
+ let progressPage = gShadowRoot.querySelector("div[name='page-progress']");
+ let header = progressPage.querySelector("h1");
+
+ gWiz.setAttribute("data-import-complete-success-string", "test string");
+
+ gWiz.setState({
+ page: MigrationWizardConstants.PAGES.PROGRESS,
+ key: "chrome",
+ progress: {
+ [MigrationWizardConstants.DISPLAYED_RESOURCE_TYPES.EXTENSIONS]: {
+ value: MigrationWizardConstants.PROGRESS_VALUE.SUCCESS,
+ },
+ [MigrationWizardConstants.DISPLAYED_RESOURCE_TYPES.FORMDATA]: {
+ value: MigrationWizardConstants.PROGRESS_VALUE.SUCCESS,
+ },
+ },
+ });
+
+ is(header.textContent, "test string", "import success header text content is changed to correct value");
+ gWiz.removeAttribute("data-import-complete-success-string");
+ });
</script>
</head>
<body>