Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format and rename test examples file #3343

Merged
merged 5 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading