Skip to content

Commit

Permalink
Remove app-b prefix from specs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthillco committed Dec 17, 2024
1 parent a763c22 commit 7246683
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
28 changes: 14 additions & 14 deletions spec/javascripts/unit/modules/app-b-main-navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ describe('Main Menu Block module', function () {

beforeEach(function () {
var DOM =
`<div class="app-b-main-nav" data-module="app-b-main-nav">
`<div class="main-nav" data-module="main-nav">
<h2 class="govuk-visually-hidden">Secondary navigation menu</h2>
<div class="app-b-main-nav__button-container app-b-main-nav__button-container--collapsed js-app-b-main-nav__button-container">
<div class="main-nav__button-container main-nav__button-container--collapsed js-main-nav__button-container">
<div class="govuk-width-container">
<button type="button" class="app-b-main-nav__button app-b-main-nav__button--no-js govuk-link govuk-link--no-underline" aria-expanded="false" aria-controls="app-b-main-nav__nav-container">
<button type="button" class="main-nav__button main-nav__button--no-js govuk-link govuk-link--no-underline" aria-expanded="false" aria-controls="main-nav__nav-container">
Landing page menu
</button>
</div>
</div>
<div class="app-b-main-nav__nav-container app-b-main-nav__nav-container--js-hidden govuk-width-container js-app-b-main-nav__nav-container" id="app-b-main-nav__nav-container">
<div class="main-nav__nav-container main-nav__nav-container--js-hidden govuk-width-container js-main-nav__nav-container" id="main-nav__nav-container">
<nav aria-label="Secondary">
<h3 class="govuk-heading-s">First heading</h3>
<ul class="app-b-main-nav__list">
<li class="app-b-main-nav__list-item">
<ul class="main-nav__list">
<li class="main-nav__list-item">
<a class="govuk-link govuk-link--no-underline govuk-link--no-visited-state" href="/landing-page/homepage">Landing page homepage very long text here to demonstrate wrapping</a>
</li>
</ul>
<h3 class="govuk-heading-s">Goals</h3>
<ul class="app-b-main-nav__list">
<li class="app-b-main-nav__list-item">
<ul class="main-nav__list">
<li class="main-nav__list-item">
<a class="govuk-link govuk-link--no-underline govuk-link--no-visited-state" href="/landing-page/goal-1">Goal 1</a>
</li>
</ul>
<h3 class="govuk-heading-s">Tasks</h3>
<ul class="app-b-main-nav__list">
<li class="app-b-main-nav__list-item">
<ul class="main-nav__list">
<li class="main-nav__list-item">
<a class="govuk-link govuk-link--no-underline govuk-link--no-visited-state" href="/landing-page/be-kinder">Be kinder</a>
</li>
</ul>
Expand All @@ -50,7 +50,7 @@ describe('Main Menu Block module', function () {
})

it('removes the no-js class from the button on initialisation', function () {
expect(document.querySelector('app-b-main-nav__button--no-js')).toBe(null)
expect(document.querySelector('main-nav__button--no-js')).toBe(null)
})

it('toggles aria expanded on the button when it is clicked', function () {
Expand All @@ -62,7 +62,7 @@ describe('Main Menu Block module', function () {

it('toggles the show/hide class when the button is clicked', function () {
var button = el.querySelector('button')
var toggledClass = '.app-b-main-nav__nav-container--js-hidden'
var toggledClass = '.main-nav__nav-container--js-hidden'
expect(document.querySelector(toggledClass)).not.toBe(null)
window.GOVUK.triggerEvent(button, 'click')
expect(document.querySelector(toggledClass)).toBe(null)
Expand All @@ -72,7 +72,7 @@ describe('Main Menu Block module', function () {

it('toggles the button container border when the button is clicked', function () {
var button = el.querySelector('button')
var toggledClass = '.app-b-main-nav__button-container--collapsed'
var toggledClass = '.main-nav__button-container--collapsed'
expect(document.querySelector(toggledClass)).not.toBe(null)
window.GOVUK.triggerEvent(button, 'click')
expect(document.querySelector(toggledClass)).toBe(null)
Expand All @@ -81,7 +81,7 @@ describe('Main Menu Block module', function () {
})

it('toggles the show/hide class when the toggleMenu function is called', function () {
var toggledClass = '.app-b-main-nav__nav-container--js-hidden'
var toggledClass = '.main-nav__nav-container--js-hidden'
expect(document.querySelector(toggledClass)).not.toBe(null)
module.toggleMenu()
expect(document.querySelector(toggledClass)).toBe(null)
Expand Down
14 changes: 7 additions & 7 deletions spec/system/landing_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@

expect(page).to have_selector(".landing-page .govuk-block__hero")
expect(page).to have_selector(".govuk-block__hero picture")
expect(page).to have_selector(".govuk-block__hero .app-b-hero__textbox")
expect(page).to have_selector(".govuk-block__hero .hero__textbox")
end

it "renders a card" do
visit base_path

expect(page).to have_selector(".landing-page .app-b-card")
expect(page).to have_selector(".app-b-card .app-b-card__textbox")
expect(page).to have_selector(".app-b-card .app-b-card__figure")
expect(page).to have_selector(".app-b-card__figure .app-b-card__image")
expect(page).to have_selector(".landing-page .card")
expect(page).to have_selector(".card .card__textbox")
expect(page).to have_selector(".card .card__figure")
expect(page).to have_selector(".card__figure .card__image")
end

it "renders a column layout" do
visit base_path

expect(page).to have_selector(".landing-page .app-b-columns-layout")
expect(page).to have_selector(".landing-page .columns-layout")
end

it "renders a blocks container" do
Expand All @@ -82,7 +82,7 @@
it "renders main navigation" do
visit base_path

expect(page).to have_selector(".app-b-main-nav")
expect(page).to have_selector(".main-nav")
end

it "renders breadcrumbs" do
Expand Down

0 comments on commit 7246683

Please sign in to comment.