Skip to content

Commit

Permalink
Adding try catch to initGnav
Browse files Browse the repository at this point in the history
  • Loading branch information
bandana147 committed Sep 24, 2024
1 parent f8a01e0 commit 283137c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/blocks/global-navigation/global-navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
unavVersion,
} from './test-utilities.js';
import { setConfig, getLocale } from '../../../libs/utils/utils.js';
import initGnav, { getUniversalNavLocale, osMap } from '../../../libs/blocks/global-navigation/global-navigation.js';
import initNav, { getUniversalNavLocale, osMap } from '../../../libs/blocks/global-navigation/global-navigation.js';
import { isDesktop, isTangentToViewport, toFragment } from '../../../libs/blocks/global-navigation/utilities/utilities.js';
import logoOnlyNav from './mocks/global-navigation-only-logo.plain.js';
import longNav from './mocks/global-navigation-long.plain.js';
Expand All @@ -24,6 +24,14 @@ import { getConfig } from '../../../tools/send-to-caas/send-utils.js';
// TODO
// - test localization

async function initGnav(block) {
try {
await initNav(block)
} catch(e) {
// should throw error
}
}

describe('global navigation', () => {
before(() => {
document.head.innerHTML = `<link rel="icon" href="/libs/img/favicons/favicon.ico" size="any">
Expand Down

0 comments on commit 283137c

Please sign in to comment.