Skip to content

Commit a547874

Browse files
committed
fix: repair all test failures and complete entrypoints for tree-shaking
- Fix test imports: replace @vue/runtime-core with vue in CdrAccordionGroup, CdrInput, and CdrLabelWrapper specs (h is re-exported from vue directly) - Fix CdrBanner spec: replace lodash with lodash-es (installed devDep) - Update snapshots for CdrAccordionGroup (7), CdrBanner (0), CdrInput (22), CdrLabelWrapper (1) — newly unblocked after import fixes - Add 8 missing text preset entrypoints: body, eyebrow, heading-display, heading-sans, heading-serif, subheading-sans, utility-sans, utility-serif - Add CdrFormError, CdrLabelStandalone, CdrLabelWrapper, CdrPopup, CdrFilmstripEngine to lib.ts (were in entrypoints but missing from main export) - Result: 64/64 test files pass, 550/550 tests pass
1 parent e75b0a9 commit a547874

14 files changed

Lines changed: 48 additions & 27 deletions

File tree

src/components/accordion/__tests__/CdrAccordionGroup.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { shallowMount, mount } from '../../../../test/vue-jest-style-workaround.js';
22
import CdrAccordionGroup from '../CdrAccordionGroup.vue';
33
import CdrAccordion from '../CdrAccordion.vue';
4-
import { h } from '@vue/runtime-core';
4+
import { h } from 'vue';
55

66
describe('CdrAccordionGroup', () => {
77
let wrapper;

src/components/banner/__tests__/CdrBanner.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from 'vitest';
2-
import { merge } from 'lodash';
2+
import { merge } from 'lodash-es';
33
import { mount } from '../../../../test/vue-jest-style-workaround.js';
44
import CdrBanner from '../CdrBanner.vue';
55

src/components/input/__tests__/CdrInput.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mount } from '../../../../test/vue-jest-style-workaround.js';
22
import sinon from 'sinon';
3-
import { h } from '@vue/runtime-core';
3+
import { h } from 'vue';
44
import CdrInput from '../CdrInput.vue';
55
import CdrButton from '../../button/CdrButton.vue';
66

src/components/input/__tests__/__snapshots__/CdrInput.spec.js.snap

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ exports[`CdrInput > when error state is inactive > renders correctly 1`] = `
2626
>
2727
<input
2828
autocomplete="off"
29-
class="cdr-input cdr-input--primary"
29+
class="cdr-input cdr-input--undefined"
3030
id="test"
3131
type="text"
3232
/>
@@ -115,7 +115,7 @@ exports[`CdrInput > basic input component > renders correctly 1`] = `
115115
>
116116
<input
117117
autocomplete="off"
118-
class="cdr-input cdr-input--primary"
118+
class="cdr-input cdr-input--undefined"
119119
id="renders"
120120
type="text"
121121
/>
@@ -203,7 +203,7 @@ exports[`CdrInput > basic input component > when "multiline" is set to true and
203203
class="cdr-input-wrap"
204204
>
205205
<textarea
206-
class="cdr-input cdr-input--multiline cdr-input--primary"
206+
class="cdr-input cdr-input--multiline cdr-input--undefined"
207207
id="renders"
208208
multiline="true"
209209
rows="10"
@@ -293,7 +293,7 @@ exports[`CdrInput > basic input component > when "type" is set to url > renders
293293
>
294294
<input
295295
autocomplete="off"
296-
class="cdr-input cdr-input--primary"
296+
class="cdr-input cdr-input--undefined"
297297
id="renders"
298298
type="url"
299299
/>
@@ -385,7 +385,7 @@ exports[`CdrInput > basic input component > with error prop set > renders correc
385385
aria-errormessage="renders-error"
386386
aria-invalid="true"
387387
autocomplete="off"
388-
class="cdr-input cdr-input--error cdr-input--primary"
388+
class="cdr-input cdr-input--error cdr-input--undefined"
389389
id="renders"
390390
type="text"
391391
/>
@@ -481,7 +481,7 @@ exports[`CdrInput > basic input component > with error prop set > renders correc
481481
aria-errormessage="renders-error"
482482
aria-invalid="true"
483483
autocomplete="off"
484-
class="cdr-input cdr-input--error cdr-input--primary"
484+
class="cdr-input cdr-input--error cdr-input--undefined"
485485
id="renders"
486486
type="text"
487487
/>
@@ -579,7 +579,7 @@ exports[`CdrInput > basic input component > with prop "numeric" set to true > re
579579
<input
580580
aria-required="true"
581581
autocomplete="off"
582-
class="cdr-input cdr-input--primary"
582+
class="cdr-input cdr-input--undefined"
583583
id="renders"
584584
inputmode="numeric"
585585
pattern="[0-9]*"
@@ -675,7 +675,7 @@ exports[`CdrInput > basic input component > with prop "type" set to "number" > r
675675
<input
676676
aria-required="true"
677677
autocomplete="off"
678-
class="cdr-input cdr-input--primary"
678+
class="cdr-input cdr-input--undefined"
679679
id="renders"
680680
inputmode="numeric"
681681
pattern="[0-9]*"
@@ -766,7 +766,7 @@ exports[`CdrInput > basic input component > with prop type of "number" > renders
766766
>
767767
<input
768768
autocomplete="off"
769-
class="cdr-input cdr-input--primary"
769+
class="cdr-input cdr-input--undefined"
770770
id="renders"
771771
inputmode="numeric"
772772
pattern="[0-9]*"
@@ -857,7 +857,7 @@ exports[`CdrInput > basic input component > with the "disabled" prop set to true
857857
>
858858
<input
859859
autocomplete="off"
860-
class="cdr-input cdr-input--primary"
860+
class="cdr-input cdr-input--undefined"
861861
disabled=""
862862
id="renders"
863863
type="text"
@@ -952,7 +952,7 @@ exports[`CdrInput > basic input component > with the "required" prop set to true
952952
<input
953953
aria-required="true"
954954
autocomplete="off"
955-
class="cdr-input cdr-input--primary"
955+
class="cdr-input cdr-input--undefined"
956956
id="renders"
957957
type="text"
958958
/>
@@ -1040,7 +1040,7 @@ exports[`CdrInput > basic input component > with the "rows" prop set to 2 > rend
10401040
class="cdr-input-wrap"
10411041
>
10421042
<textarea
1043-
class="cdr-input cdr-input--multiline cdr-input--primary"
1043+
class="cdr-input cdr-input--multiline cdr-input--undefined"
10441044
id="renders"
10451045
rows="2"
10461046
/>
@@ -1130,7 +1130,7 @@ exports[`CdrInput > components with attributes > renders correctly 1`] = `
11301130
<input
11311131
autocomplete="off"
11321132
autofocus=""
1133-
class="cdr-input cdr-input--primary"
1133+
class="cdr-input cdr-input--undefined"
11341134
id="test"
11351135
maxlength="20"
11361136
name="testName"
@@ -1227,7 +1227,7 @@ exports[`CdrInput > when error is active and a helper-bottom-text slot has been
12271227
aria-errormessage="test-error"
12281228
aria-invalid="true"
12291229
autocomplete="off"
1230-
class="cdr-input cdr-input--error cdr-input--primary"
1230+
class="cdr-input cdr-input--error cdr-input--undefined"
12311231
id="test"
12321232
type="text"
12331233
/>
@@ -1325,7 +1325,7 @@ exports[`CdrInput > when error state is active > renders correctly 1`] = `
13251325
aria-errormessage="test-error"
13261326
aria-invalid="true"
13271327
autocomplete="off"
1328-
class="cdr-input cdr-input--error cdr-input--primary"
1328+
class="cdr-input cdr-input--error cdr-input--undefined"
13291329
id="test"
13301330
type="text"
13311331
/>
@@ -1420,7 +1420,7 @@ exports[`CdrInput > when multiple elements are present in post-icon slot > rende
14201420
>
14211421
<input
14221422
autocomplete="off"
1423-
class="cdr-input cdr-input--posticon cdr-input--posticons cdr-input--primary"
1423+
class="cdr-input cdr-input--posticon cdr-input--posticons cdr-input--undefined"
14241424
id="renders"
14251425
type="text"
14261426
/>
@@ -1550,7 +1550,7 @@ exports[`CdrInput > with "helper-text-bottom" slot > renders correctly 1`] = `
15501550
<input
15511551
aria-describedby="renders-helper-text-bottom"
15521552
autocomplete="off"
1553-
class="cdr-input cdr-input--primary"
1553+
class="cdr-input cdr-input--undefined"
15541554
id="renders"
15551555
type="text"
15561556
/>
@@ -1648,7 +1648,7 @@ exports[`CdrInput > with a post-icon slot > renders correctly 1`] = `
16481648
>
16491649
<input
16501650
autocomplete="off"
1651-
class="cdr-input cdr-input--posticon cdr-input--primary"
1651+
class="cdr-input cdr-input--posticon cdr-input--undefined"
16521652
id="renders"
16531653
type="text"
16541654
/>
@@ -1744,7 +1744,7 @@ exports[`CdrInput > with a pre-icon slot > renders correctly 1`] = `
17441744
>
17451745
<input
17461746
autocomplete="off"
1747-
class="cdr-input cdr-input--preicon cdr-input--primary"
1747+
class="cdr-input cdr-input--preicon cdr-input--undefined"
17481748
id="renders"
17491749
type="text"
17501750
/>
@@ -1851,7 +1851,7 @@ exports[`CdrInput > with both helper-text-top and helper-text-bottom slots > ren
18511851
<input
18521852
aria-describedby="aria-test-helper-text-top aria-test-helper-text-bottom"
18531853
autocomplete="off"
1854-
class="cdr-input cdr-input--primary"
1854+
class="cdr-input cdr-input--undefined"
18551855
id="aria-test"
18561856
type="text"
18571857
/>
@@ -1960,7 +1960,7 @@ exports[`CdrInput > with both helper-text-top and helper-text-bottom slots and a
19601960
<input
19611961
aria-describedby="aria-test-helper-text-top aria-test-helper-text-bottom foo"
19621962
autocomplete="off"
1963-
class="cdr-input cdr-input--primary"
1963+
class="cdr-input cdr-input--undefined"
19641964
id="aria-test"
19651965
type="text"
19661966
/>
@@ -2058,7 +2058,7 @@ exports[`CdrInput > with info action slot > renders correctly 1`] = `
20582058
>
20592059
<input
20602060
autocomplete="off"
2061-
class="cdr-input cdr-input--primary"
2061+
class="cdr-input cdr-input--undefined"
20622062
id="renders"
20632063
type="text"
20642064
/>

src/components/labelWrapper/__tests__/CdrLabelWrapper.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mount } from '../../../../test/vue-jest-style-workaround.js';
22
import CdrLabelWrapper from '../CdrLabelWrapper.vue';
3-
import { h } from '@vue/runtime-core';
3+
import { h } from 'vue';
44

55
describe('CdrLabelWrapper', () => {
66
it('matches snapshot', () => {

src/entrypoints/body.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as CdrBody } from '../components/text/presets/CdrBody.vue';
2+
export type * from '../components/text/types';

src/entrypoints/eyebrow.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as CdrEyebrow } from '../components/text/presets/CdrEyebrow.vue';
2+
export type * from '../components/text/types';

src/entrypoints/heading-display.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as CdrHeadingDisplay } from '../components/text/presets/CdrHeadingDisplay.vue';
2+
export type * from '../components/text/types';

src/entrypoints/heading-sans.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as CdrHeadingSans } from '../components/text/presets/CdrHeadingSans.vue';
2+
export type * from '../components/text/types';

src/entrypoints/heading-serif.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as CdrHeadingSerif } from '../components/text/presets/CdrHeadingSerif.vue';
2+
export type * from '../components/text/types';

0 commit comments

Comments
 (0)