Skip to content

Commit

Permalink
Update cross-service-header.js to use init
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinJJones committed May 17, 2024
1 parent 3dab7a2 commit 62110c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
this.$header = $module
this.$navigation = $module && $module.querySelectorAll('[data-one-login-header-nav]')
this.$numberOfNavs = this.$navigation && this.$navigation.length

this.init()
}
/**
* Initialise header
Expand Down
6 changes: 2 additions & 4 deletions spec/javascripts/components/cross-service-header-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ describe('The _layout_header_one_login', function () {
'use strict'

var container
var thisModule

beforeEach(function () {
container = document.createElement('div')
Expand Down Expand Up @@ -134,7 +133,8 @@ describe('The _layout_header_one_login', function () {
document.body.appendChild(container)

var $element = document.querySelector('[data-module="cross-service-header"]')
thisModule = new GOVUK.Modules.CrossServiceHeader($element)
/* eslint-disable no-new */
new GOVUK.Modules.CrossServiceHeader($element)

spyOn(GOVUK.analytics, 'trackEvent')
})
Expand All @@ -151,7 +151,6 @@ describe('The _layout_header_one_login', function () {
var $button

beforeEach(function () {
thisModule.init()
$button = document.querySelector('.gem-c-cross-service-header__button--one-login.js-x-header-toggle')
})

Expand Down Expand Up @@ -227,7 +226,6 @@ describe('The _layout_header_one_login', function () {
var $button

beforeEach(function () {
thisModule.init()
$button = document.querySelector('.gem-c-cross-service-header__button--service-header.js-x-header-toggle')
})

Expand Down

0 comments on commit 62110c5

Please sign in to comment.