Skip to content

Commit 6325a53

Browse files
committed
Fix EmptyState typography tests
1 parent 0b1555d commit 6325a53

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

polaris-react/src/components/EmptySearchResult/tests/EmptySearchResult.test.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ import {emptySearch} from '../illustrations';
88
describe('<EmptySearchResult />', () => {
99
it("displays the title with style 'Display Small'", () => {
1010
const wrapper = mountWithApp(<EmptySearchResult title="Foo" />);
11-
const displaySmalls = wrapper.findWhere(
12-
(wrap) => wrap.is(Text) && wrap.prop('variant') === 'headingXl',
11+
const textHeadingLg = wrapper.findWhere(
12+
(wrap) => wrap.is(Text) && wrap.prop('variant') === 'headingLg',
1313
);
1414

15-
expect(wrapper).toContainReactComponent(Text, {variant: 'headingXl'});
16-
expect(displaySmalls).toContainReactText('Foo');
15+
expect(wrapper).toContainReactComponent(Text, {
16+
variant: 'headingLg',
17+
as: 'p',
18+
});
19+
expect(textHeadingLg).toContainReactText('Foo');
1720
});
1821

1922
it("displays the description with style 'Body Subdued'", () => {

polaris-react/src/components/EmptyState/tests/EmptyState.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,19 @@ describe('<EmptyState />', () => {
153153
);
154154
const text = emptyState.find(Text)!;
155155

156-
expect(text).toHaveReactProps({variant: 'heading2xl'});
156+
expect(text).toHaveReactProps({variant: 'headingXl'});
157157
expect(text).toContainReactText(expectedHeading);
158158
});
159159

160-
it('renders a headingXl Text when in a content context', () => {
160+
it('renders a headingLg Text when in a content context', () => {
161161
const emptyStateInContentContext = mountWithApp(
162162
<WithinContentContext.Provider value>
163163
<EmptyState heading="Heading" image={imgSrc} />
164164
</WithinContentContext.Provider>,
165165
);
166166

167167
expect(emptyStateInContentContext).toContainReactComponent(Text, {
168-
variant: 'headingXl',
168+
variant: 'headingLg',
169169
});
170170
});
171171
});

0 commit comments

Comments
 (0)