Skip to content

Commit

Permalink
Merge branch 'main' into major-release
Browse files Browse the repository at this point in the history
  • Loading branch information
alessioventuriniAND authored Sep 13, 2024
2 parents d27e9d7 + 3c2ff03 commit f3531ae
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 159 deletions.
2 changes: 1 addition & 1 deletion lighthouse/lighthouse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ npm install -g @lhci/[email protected]
lhci healthcheck --fatal
for url in $(jq '.urls[]' ./lighthouse/urls.json); do sem
lhci collect "--url=$url" --additive --config=./lighthouse/lighthouserc.js &
done
done
sem --wait
lhci assert --config=./lighthouse/lighthouserc.js
lhci upload --config=./lighthouse/lighthouserc.js
Expand Down
2 changes: 2 additions & 0 deletions src/components/address-input/autosuggest.address.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,8 @@ describe('script: address-input', () => {
beforeEach(async () => {
await setTestPage('/test', renderComponent('address-input', EXAMPLE_ADDRESS_INPUT_WITH_API));
await page.evaluate(() => document.documentElement.setAttribute('lang', 'cy'));

await setTimeout(50);
});

it('then the fetch url should contain the favour Welsh parameter', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
EXAMPLE_HEADER_LANGUAGE_CONFIG,
EXAMPLE_HEADER_NAVIGATION_WITH_SUBNAVIGATION_CONFIG,
EXAMPLE_HEADER_NAVIGATION_WITH_SITESEARCHAUTOSUGGEST,
} from './_test_examples';
} from './_test-examples';

describe('FOR: Header', () => {
describe('GIVEN: Params: none', () => {
Expand Down
153 changes: 153 additions & 0 deletions src/components/header/_test-examples.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
export const EXAMPLE_HEADER_BASIC = {
title: 'Header title',
};

export const EXAMPLE_SERVICE_LINKS_CONFIG = {
id: 'service-links',
ariaLabel: 'Services menu',
classes: 'custom-class',
toggleServicesButton: {
text: 'Menu',
ariaLabel: 'Toggle services menu',
},
};

export const EXAMPLE_HEADER_SERVICE_LINKS_MULTIPLE = {
...EXAMPLE_HEADER_BASIC,
serviceLinks: {
...EXAMPLE_SERVICE_LINKS_CONFIG,
itemsList: [
{
title: 'Title 1',
url: '#1',
},
{
title: 'Title 2',
url: '#2',
},
{
title: 'Title 3',
url: '#3',
},
],
},
};

export const EXAMPLE_HEADER_SERVICE_LINKS_SINGLE = {
...EXAMPLE_HEADER_BASIC,
serviceLinks: {
...EXAMPLE_SERVICE_LINKS_CONFIG,
itemsList: [
{
title: 'Title',
url: '#0',
},
],
},
};

export const EXAMPLE_HEADER_LANGUAGE_CONFIG = {
language: {
languages: [
{
url: '#0',
ISOCode: 'en',
text: 'English',
buttonAriaLabel: 'Language selector. Current language: English',
chooseLanguage: 'Choose language',
current: true,
},
{
url: '#0',
ISOCode: 'cy',
text: 'Cymraeg',
buttonAriaLabel: 'Dewisydd iaith. Iaith gyfredol: Cymraeg',
chooseLanguage: 'Dewiswch iaith',
current: false,
},
],
},
};

export const EXAMPLE_HEADER_NAVIGATION_WITH_SUBNAVIGATION_CONFIG = {
navigation: {
id: 'main-nav',
ariaLabel: 'Main menu',
currentPath: '#1',
currentPageTitle: 'Guidance',
itemsList: [
{
title: 'Home',
url: '#0',
},
{
title: 'Guidance',
url: '#1',
},
],
toggleNavigationButton: {
text: 'Menu',
ariaLabel: 'Toggle main menu',
},
subNavigation: {
id: 'sub-nav',
overviewURL: '#overview',
overviewText: 'Overview',
ariaLabel: 'Section menu',
currentPath: '#1',
itemsList: [
{
title: 'Sub nav item 1',
url: '#0',
classes: 'custom-class-sub-item-1',
id: 'sub-item-1',
},
{
title: 'Sub nav item 2',
url: '#1',
classes: 'custom-class-sub-item-2',
id: 'sub-item-2',
},
],
},
},
};

export const EXAMPLE_HEADER_NAVIGATION_WITH_SITESEARCHAUTOSUGGEST = {
navigation: {
id: 'main-nav',
ariaLabel: 'Main menu',
currentPath: '#home',
itemsList: [
{
title: 'Home',
url: '#home',
},
{
title: 'Guidance',
url: '#0',
},
],
toggleNavigationButton: {
text: 'Menu',
ariaLabel: 'Toggle main menu',
},
},
siteSearchAutosuggest: {
label: 'label',
instructions: 'Use up and down keys to navigate.',
ariaYouHaveSelected: 'You have selected',
ariaMinChars: 'Enter 3 or more characters for suggestions.',
minChars: 3,
ariaResultsLabel: 'Country suggestions',
ariaOneResult: 'There is one suggestion available.',
ariaNResults: 'There are {n} suggestions available.',
ariaLimitedResults: 'Type more characters to improve your search',
moreResults: 'Continue entering to improve suggestions',
resultsTitle: 'Suggestions',
resultsTitleId: 'country-of-birth-suggestions',
noResults: 'No suggestions found.',
typeMore: 'Continue entering to get suggestions',
language: 'en-gb',
},
};
157 changes: 0 additions & 157 deletions src/components/header/_test_examples.js

This file was deleted.

0 comments on commit f3531ae

Please sign in to comment.