Skip to content

Commit 4c56c76

Browse files
authored
Merge pull request #31141 from storybookjs/yann/rename-local-tests
Core: Rename local tests to interactions
2 parents fd5928f + e7b654d commit 4c56c76

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

code/addons/vitest/src/components/TestProviderRender.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
124124
ComponentProps<typeof TestStatusIcon>['status'],
125125
string,
126126
] = fatalError
127-
? ['critical', 'Local tests crashed']
127+
? ['critical', 'Component tests crashed']
128128
: componentTestStatusValueToStoryIds['status-value:error'].length > 0
129129
? ['negative', 'Component tests failed']
130130
: isRunning
@@ -137,7 +137,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
137137
ComponentProps<typeof TestStatusIcon>['status'],
138138
string,
139139
] = fatalError
140-
? ['critical', 'Local tests crashed']
140+
? ['critical', 'Component tests crashed']
141141
: a11yStatusValueToStoryIds['status-value:error'].length > 0
142142
? ['negative', 'Accessibility tests failed']
143143
: a11yStatusValueToStoryIds['status-value:warning'].length > 0
@@ -153,7 +153,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
153153
<Heading>
154154
<Info>
155155
{entry ? (
156-
<Title id="testing-module-title">Run local tests</Title>
156+
<Title id="testing-module-title">Run component tests</Title>
157157
) : (
158158
<Title
159159
id="testing-module-title"
@@ -164,12 +164,12 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
164164
}
165165
>
166166
{currentRun.unhandledErrors.length === 1
167-
? 'Local tests completed with an error'
167+
? 'Component tests completed with an error'
168168
: currentRun.unhandledErrors.length > 1
169-
? 'Local tests completed with errors'
169+
? 'Component tests completed with errors'
170170
: fatalError
171-
? 'Local tests didn’t complete'
172-
: 'Run local tests'}
171+
? 'Component tests didn’t complete'
172+
: 'Run component tests'}
173173
</Title>
174174
)}
175175
<Description
@@ -264,7 +264,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
264264
<Row>
265265
<ListItem
266266
as="label"
267-
title="Component tests"
267+
title="Interactions"
268268
icon={entry ? null : <Checkbox type="checkbox" checked disabled />}
269269
/>
270270
<WithTooltip
@@ -336,7 +336,7 @@ export const TestProviderRender: FC<TestProviderRenderProps> = ({
336336
: currentRun.coverageSummary
337337
? 'View coverage report'
338338
: fatalError
339-
? 'Local tests crashed'
339+
? 'Component tests crashed'
340340
: 'Run tests to calculate coverage'
341341
}
342342
/>

code/core/src/component-testing/components/EmptyState.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ export const Empty = () => {
4242
return (
4343
<div>
4444
<EmptyTabContent
45-
title="Component testing"
45+
title="Interactions"
4646
description={
4747
<>
48-
Component tests allow you to verify the functional aspects of UIs. Write a play function
48+
Interactions allow you to verify the functional aspects of UIs. Write a play function
4949
for your story and you&apos;ll see it run here.
5050
</>
5151
}

code/core/src/component-testing/components/Interaction.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ export const Interaction = ({
229229
<RowLabel aria-label="Render step" call={call} disabled>
230230
{call.status === CallStates.ERROR ? (
231231
<StatusIcon status={CallStates.ERROR} />
232+
) : call.status === CallStates.ACTIVE ? (
233+
<StatusIcon status={CallStates.ACTIVE} />
232234
) : (
233235
<RenderIcon />
234236
)}
@@ -240,7 +242,7 @@ export const Interaction = ({
240242
<WithTooltip
241243
trigger="hover"
242244
hasChrome={false}
243-
tooltip={<Note note="Render is the first step of all component tests" />}
245+
tooltip={<Note note="Render is the first step of all interactions" />}
244246
>
245247
<RenderLockIcon />
246248
</WithTooltip>

code/core/src/component-testing/components/TestDiscrepancyMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const TestDiscrepancyMessage = ({ browserTestStatus }: TestDiscrepancyMes
4848

4949
return (
5050
<Wrapper>
51-
This component test passed in {passed}, but the tests failed in {failed}.{' '}
51+
This interaction test passed in {passed}, but the tests failed in {failed}.{' '}
5252
<Link href={docsUrl} target="_blank" withArrow>
5353
Learn what could cause this
5454
</Link>

test-storybooks/portable-stories-kitchen-sink/react/e2e-tests/component-testing.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ test.describe("component testing", () => {
114114
"Test status: success"
115115
);
116116
await expect(sbPage.panelContent()).toContainText(
117-
/This component test passed in the CLI, but the tests failed in this browser/
117+
/This interaction test passed in the CLI, but the tests failed in this browser/
118118
);
119119

120120
// Assert discrepancy: CLI fail + Browser pass
@@ -127,7 +127,7 @@ test.describe("component testing", () => {
127127
"Test status: error"
128128
);
129129
await expect(sbPage.panelContent()).toContainText(
130-
/This component test passed in this browser, but the tests failed in the CLI/
130+
/This interaction test passed in this browser, but the tests failed in the CLI/
131131
);
132132
});
133133

@@ -147,7 +147,7 @@ test.describe("component testing", () => {
147147
.getByRole("button", { name: "test" });
148148
await expect(storyElement).toBeVisible({ timeout: 30000 });
149149

150-
await expect(page.locator('#testing-module-title')).toHaveText('Run local tests');
150+
await expect(page.locator('#testing-module-title')).toHaveText('Run component tests');
151151

152152
const testingModuleDescription = await page.locator('#testing-module-description');
153153

0 commit comments

Comments
 (0)