Skip to content

Commit

Permalink
Merge branch 'main' into enhancement/139/testing-refactor-button
Browse files Browse the repository at this point in the history
  • Loading branch information
SriHV authored Nov 13, 2024
2 parents dfb4456 + 0799182 commit 144a6b0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/components/accordion/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('FOR: Macro: Accordion', () => {
expect(titleText).toBe('Title for item 1');
});
});
describe('WHEN: titleTag is not provided', () => {
describe('WHEN: headingLevel is not provided', () => {
const $ = cheerio.load(
renderComponent('accordion', {
itemsList: [
Expand All @@ -79,7 +79,7 @@ describe('FOR: Macro: Accordion', () => {
expect(titleTag).toBe('h2');
});
});
describe('WHEN: titleTag is provided', () => {
describe('WHEN: headingLevel is provided', () => {
const $ = cheerio.load(
renderComponent('accordion', {
itemsList: [
Expand Down
22 changes: 11 additions & 11 deletions src/components/browser-banner/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,48 @@ describe('FOR: Macro: Browser-banner', () => {
describe('WHEN: params are at default state', () => {
const $ = cheerio.load(renderComponent('browser-banner', {}));

it('THEN: passes jest-axe checks', async () => {
test('THEN: passes jest-axe checks', async () => {
const results = await axe($.html());
expect(results).toHaveNoViolations();
});

it('THEN: has the english default bannerLeadingText', () => {
test('THEN: has the english default bannerLeadingText', () => {
const bannerLeadingText = $('.ons-browser-banner__lead').text().trim();
expect(bannerLeadingText).toBe('This website no longer supports your browser.');
});

it('THEN: has the english default bannerCTA', () => {
test('THEN: has the english default bannerCTA', () => {
const bannerCtaHtml = $('.ons-browser-banner__cta').text().trim();
expect(bannerCtaHtml).toBe('You can upgrade your browser to the latest version.');
});

it('THEN: has the english default bannerLinkUrl', () => {
test('THEN: has the english default bannerLinkUrl', () => {
expect($('.ons-browser-banner__link').attr('href')).toBe('https://www.ons.gov.uk/help/browsers');
});
});

describe('WHEN: params are at default and language is set to welsh', () => {
const $ = cheerio.load(renderComponent('browser-banner', { lang: 'cy' }));

it('THEN: has the welsh default bannerLeadingText', () => {
test('THEN: has the welsh default bannerLeadingText', () => {
const bannerLeadingText = $('.ons-browser-banner__lead').text().trim();
expect(bannerLeadingText).toBe('Nid yw’r wefan hon yn cefnogi eich porwr mwyach.');
});

it('THEN: has the welsh default bannerCTA', () => {
test('THEN: has the welsh default bannerCTA', () => {
const bannerCtaHtml = $('.ons-browser-banner__cta').text().trim();
expect(bannerCtaHtml).toBe('Gallwch ddiweddaru eich porwr i’r fersiwn ddiweddaraf.');
});

it('THEN: has the welsh default bannerLinkUrl', () => {
test('THEN: has the welsh default bannerLinkUrl', () => {
expect($('.ons-browser-banner__link').attr('href')).toBe('https://cy.ons.gov.uk/help/browsers');
});
});
});

describe('GIVEN: Params: wide', () => {
describe('WHEN: wide is set to true', () => {
it('THEN: has container--wide class', () => {
test('THEN: has container--wide class', () => {
const $ = cheerio.load(
renderComponent('browser-banner', {
...{},
Expand All @@ -64,7 +64,7 @@ describe('FOR: Macro: Browser-banner', () => {
});

describe('WHEN: wide is not set', () => {
it('THEN: does not have container--wide class', () => {
test('THEN: does not have container--wide class', () => {
const $ = cheerio.load(
renderComponent('browser-banner', {
...{},
Expand All @@ -78,7 +78,7 @@ describe('FOR: Macro: Browser-banner', () => {

describe('GIVEN: Params: fullWidth', () => {
describe('WHEN: fullWidth is set to true', () => {
it('THEN: has container--full-width class', () => {
test('THEN: has container--full-width class', () => {
const $ = cheerio.load(
renderComponent('browser-banner', {
...{},
Expand All @@ -91,7 +91,7 @@ describe('FOR: Macro: Browser-banner', () => {
});

describe('WHEN: fullWidth is not set', () => {
it('THEN: does not have container--full-width class', () => {
test('THEN: does not have container--full-width class', () => {
const $ = cheerio.load(
renderComponent('browser-banner', {
...{},
Expand Down

0 comments on commit 144a6b0

Please sign in to comment.