summaryrefslogtreecommitdiffstats
path: root/browser/components/translations/tests/browser/browser_translations_full_page_panel_init_failure.js
blob: 34986726b83bf800df6074423b72413e91f9aad2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Any copyright is dedicated to the Public Domain.
   https://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

/**
 * This test case verifies that the proper error message is displayed in
 * the FullPageTranslationsPanel if the panel tries to open, but the language
 * dropdown menus fail to initialize.
 */
add_task(async function test_full_page_translations_panel_init_failure() {
  const { cleanup } = await loadTestPage({
    page: SPANISH_PAGE_URL,
    languagePairs: LANGUAGE_PAIRS,
  });

  TranslationsPanelShared.simulateLangListError();
  await FullPageTranslationsTestUtils.openPanel({
    onOpenPanel: FullPageTranslationsTestUtils.assertPanelViewInitFailure,
  });

  await FullPageTranslationsTestUtils.clickCancelButton();

  await cleanup();
});