Skip to content

Commit

Permalink
Merge pull request #640 from MyPureCloud/feature/test-speedup
Browse files Browse the repository at this point in the history
test(other): improved test run speed
  • Loading branch information
daragh-king-genesys authored Oct 3, 2024
2 parents 4865c11 + 4d6711f commit 9880ac3
Show file tree
Hide file tree
Showing 25 changed files with 27,303 additions and 13,998 deletions.
4 changes: 2 additions & 2 deletions packages/genesys-spark-chart-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"stylelint": "stylelint --fix \"**/*.{css,html,scss}\"",
"test": "TZ=UTC stencil test --spec --e2e",
"test.ci": "TZ=UTC npm run test.ci.spec",
"test.ci.e2e": "TZ=UTC stencil test --e2e --max-workers=1",
"test.ci.spec": "TZ=UTC stencil test --spec --max-workers=1",
"test.ci.e2e": "TZ=UTC stencil test --e2e --max-workers=4",
"test.ci.spec": "TZ=UTC stencil test --spec --max-workers=4",
"test.e2e": "TZ=UTC stencil test --e2e",
"test.e2e.update-snapshot": "TZ=UTC stencil test --e2e --updateSnapshot",
"test.screenshot": "TZ=UTC stencil test --e2e --screenshot",
Expand Down
4 changes: 2 additions & 2 deletions packages/genesys-spark-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"svgo": "find ./src/components/stable/gux-icon/icons/**/*.svg -type f ! -path '*/legacy/*' -exec svgo {} +",
"test": "TZ=UTC stencil test --spec --e2e",
"test.ci": "TZ=UTC npm run test.ci.spec",
"test.ci.e2e": "TZ=UTC stencil test --e2e --max-workers=1",
"test.ci.spec": "TZ=UTC stencil test --spec --max-workers=1",
"test.ci.e2e": "TZ=UTC stencil test --e2e --max-workers=4",
"test.ci.spec": "TZ=UTC stencil test --spec --max-workers=4",
"test.e2e": "TZ=UTC stencil test --e2e",
"test.e2e.update-snapshot": "TZ=UTC stencil test --e2e --updateSnapshot",
"test.screenshot": "TZ=UTC stencil test --e2e --screenshot",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { newSparkE2EPage, a11yCheck } from '../../../../test/e2eTestUtils';
import { timeZoneIdentifiers } from '../../../../i18n/time-zone/identifiers';

const date = '2022-07-07T13:35:30.100Z';

Expand All @@ -20,16 +19,4 @@ describe('gux-date-time-beta', () => {
});
});
});

describe('#render different time zones', () => {
timeZoneIdentifiers.forEach((timeZone: string) => {
it(`should work as expected for "${timeZone}"`, async () => {
const html = `<gux-date-time-beta time-zone=${timeZone} datetime="2022-07-07T12:00:00.000Z" format="full"></gux-date-time-beta>`;
const page = await newSparkE2EPage({ html });

const element = await page.find('gux-date-time-beta');
expect(element.outerHTML).toMatchSnapshot();
});
});
});
});

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { newSparkE2EPage, a11yCheck } from '../../../../test/e2eTestUtils';
import { timeZoneIdentifiers } from '../../../../i18n/time-zone/identifiers';

const date = '2022-07-07T13:35:30.100Z';

Expand All @@ -20,16 +19,4 @@ describe('gux-date-beta', () => {
});
});
});

describe('#render different time zones', () => {
timeZoneIdentifiers.forEach((timeZone: string) => {
it(`should work as expected for "${timeZone}"`, async () => {
const html = `<gux-date-beta time-zone=${timeZone} datetime="2022-07-07T12:00:00.000Z" format="full"></gux-date-beta>`;
const page = await newSparkE2EPage({ html });

const element = await page.find('gux-date-beta');
expect(element.outerHTML).toMatchSnapshot();
});
});
});
});

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,274 +1,21 @@
import { newSparkE2EPage, a11yCheck } from '../../../../test/e2eTestUtils';

describe('gux-flag-icon-beta', () => {
describe('#render different flags', () => {
[
'ad',
'ae',
'af',
'ag',
'ai',
'al',
'am',
'ao',
'ar',
'as',
'at',
'au',
'aw',
'ax',
'az',
'ba',
'bb',
'bd',
'be',
'bf',
'bg',
'bh',
'bi',
'bj',
'bl',
'bm',
'bn',
'bo',
'bq',
'br',
'bs',
'bt',
'bv',
'bw',
'by',
'bz',
'ca',
'cc',
'cd',
'cf',
'cg',
'ch',
'ci',
'ck',
'cl',
'cm',
'cn',
'co',
'cr',
'cu',
'cv',
'cw',
'cx',
'cy',
'cz',
'de',
'dj',
'dk',
'dm',
'do',
'dz',
'ec',
'ee',
'eg',
'eh',
'er',
'es',
'et',
'fi',
'fj',
'fk',
'fm',
'fo',
'fr',
'ga',
'gb',
'gd',
'ge',
'gf',
'gg',
'gh',
'gi',
'gl',
'gm',
'gn',
'gp',
'gq',
'gr',
'gs',
'gt',
'gu',
'gw',
'gy',
'hk',
'hn',
'hr',
'ht',
'hu',
'id',
'ie',
'il',
'im',
'in',
'io',
'iq',
'ir',
'is',
'it',
'je',
'jm',
'jo',
'jp',
'ke',
'kg',
'kh',
'ki',
'km',
'kn',
'kp',
'kr',
'kw',
'ky',
'kz',
'la',
'lb',
'lc',
'li',
'lk',
'lr',
'ls',
'lt',
'lu',
'lv',
'ly',
'ma',
'mc',
'md',
'me',
'mf',
'mg',
'mh',
'mk',
'ml',
'mm',
'mn',
'mo',
'mp',
'mq',
'mr',
'ms',
'mt',
'mu',
'mv',
'mw',
'mx',
'my',
'mz',
'na',
'nc',
'ne',
'nf',
'ng',
'ni',
'nl',
'no',
'np',
'nr',
'nu',
'nz',
'om',
'pa',
'pe',
'pf',
'pg',
'ph',
'pk',
'pl',
'pm',
'pn',
'pr',
'ps',
'pt',
'pw',
'py',
'qa',
're',
'ro',
'rs',
'ru',
'rw',
'sa',
'sb',
'sc',
'sd',
'se',
'sg',
'sh',
'si',
'sj',
'sk',
'sl',
'sm',
'sn',
'so',
'sr',
'ss',
'st',
'sv',
'sx',
'sy',
'sz',
'tc',
'td',
'tg',
'th',
'tj',
'tk',
'tl',
'tm',
'tn',
'to',
'tr',
'tt',
'tv',
'tw',
'tz',
'ua',
'ug',
'us',
'uy',
'uz',
'va',
'vc',
've',
'vg',
'vi',
'vn',
'vu',
'wf',
'ws',
'xk',
'ye',
'yt',
'za',
'zm',
'zw'
].forEach((flag, index) => {
it(`should render component as expected (${index + 1})`, async () => {
const html = `<gux-flag-icon-beta flag="${flag}"></gux-flag-icon-beta>`;
const page = await newSparkE2EPage({ html });
await a11yCheck(page);
it(`should render component as expected`, async () => {
const html = `<gux-flag-icon-beta flag="ie"></gux-flag-icon-beta>`;
const page = await newSparkE2EPage({ html });
await a11yCheck(page);

const element = await page.find('gux-flag-icon-beta');
expect(element.outerHTML).toMatchSnapshot();
});
const element = await page.find('gux-flag-icon-beta');
expect(element.outerHTML).toMatchSnapshot();
});

it(`should render component with screenreader text as expected (${
index + 1
})`, async () => {
const html = `<gux-flag-icon-beta flag="${flag}" screenreader-text="${flag}"></gux-flag-icon-beta>`;
const page = await newSparkE2EPage({ html });
await a11yCheck(page);
it(`should render component with screenreader text as expected`, async () => {
const html = `<gux-flag-icon-beta flag="ie" screenreader-text="ireland"></gux-flag-icon-beta>`;
const page = await newSparkE2EPage({ html });
await a11yCheck(page);

const element = await page.find('gux-flag-icon-beta');
expect(element.outerHTML).toMatchSnapshot();
});
});
const element = await page.find('gux-flag-icon-beta');
expect(element.outerHTML).toMatchSnapshot();
});
});

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ export class GuxTimeZonePickerBeta {

private getTimeZoneOption(timeZone: GuxTimeZoneListing): GuxTimeZoneOption {
const localizedGroupName = this.i18n(timeZone.name);
const localizedCountryName = this.i18n(timeZone.countryName);
const localizedCountryName = timeZone.countryName
? this.i18n(timeZone.countryName)
: undefined;
if (!localizedGroupName) {
return;
}
Expand Down
Loading

0 comments on commit 9880ac3

Please sign in to comment.