Skip to content

Commit 9367b43

Browse files
authored
misc: remove border-bottom if test is isolated in studio mode (#32492)
1 parent 623bcb9 commit 9367b43

File tree

5 files changed

+51
-3
lines changed

5 files changed

+51
-3
lines changed

cli/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ _Released 9/23/2025 (PENDING)_
1010
**Misc:**
1111

1212
- Update the styles for command grouping 'line' so on expansion it is displayed correctly. Addressed in [#32521](https://github.com/cypress-io/cypress/pull/32521)
13+
- Updated the Cypress Studio panel to not show bottom border. Addresses [#32478](https://github.com/cypress-io/cypress/issues/32478).
1314

1415
**Dependency Updates:**
1516

packages/reporter/src/attempts/attempts.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
}
4141
}
4242
}
43+
44+
&.single-studio-test {
45+
border-right: none;
46+
border-bottom: none;
47+
}
4348
}
4449

4550
.attempt-error-region {

packages/reporter/src/attempts/attempts.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ Attempt.displayName = 'Attempt'
8888

8989
interface AttemptsProps {
9090
test: TestModel
91+
isSingleStudioTest?: boolean
9192
scrollIntoView: Function
9293
}
9394

94-
const Attempts: React.FC<AttemptsProps> = observer(({ test, scrollIntoView }: AttemptsProps) => {
95+
const Attempts: React.FC<AttemptsProps> = observer(({ test, isSingleStudioTest, scrollIntoView }: AttemptsProps) => {
9596
return (<ul className={cs('attempts', {
9697
'has-multiple-attempts': test.hasMultipleAttempts,
98+
'single-studio-test': Boolean(isSingleStudioTest),
9799
})}>
98100
{test.attempts.map((attempt) => {
99101
return (

packages/reporter/src/studio/StudioTest.cy.tsx

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,46 @@ describe('StudioTest', () => {
3333
title: 'should display correct content',
3434
state: 'passed',
3535
parentTitle: 'Example Test Suite > Nested Suite',
36-
attempts: [],
36+
attempts: [
37+
{
38+
id: 'attempt-1',
39+
state: 'passed',
40+
hooks: [
41+
{
42+
id: 'hook-1',
43+
type: 'hook',
44+
name: 'test body',
45+
hookName: 'test body',
46+
state: 'passed',
47+
duration: 1000,
48+
commands: [
49+
{
50+
id: 'command-1',
51+
type: 'command',
52+
name: 'command-1',
53+
state: 'passed',
54+
duration: 1000,
55+
_isPending: () => false,
56+
renderProps: {},
57+
displayMessage: null,
58+
},
59+
],
60+
},
61+
],
62+
hookCount: {
63+
'before all': 0,
64+
'before each': 0,
65+
'after all': 0,
66+
'after each': 0,
67+
'test body': 1,
68+
},
69+
hasCommands: true,
70+
isOpen: true,
71+
sessions: [],
72+
agents: [],
73+
routes: [],
74+
},
75+
],
3776
callbackAfterUpdate: cy.stub().as('callbackAfterUpdate'),
3877
} as unknown as Test
3978

@@ -72,6 +111,7 @@ describe('StudioTest', () => {
72111
cy.get('.studio-single-test-container').should('be.visible')
73112
cy.get('.studio-header__test-section').should('be.visible')
74113
cy.get('.studio-single-test-attempts').should('be.visible')
114+
cy.get('.attempts.single-studio-test').should('have.css', 'border-bottom-style', 'none').and('have.css', 'border-right-style', 'none')
75115
cy.get('[data-cy="studio-single-test-title"]').should('contain.text', 'should display correct content')
76116
cy.get('[data-cy="spec-duration"]').should('contain', '00:02')
77117
cy.percySnapshot()

packages/reporter/src/studio/StudioTest.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const StudioTest = observer(({ appState, runnablesStore, statsStore }: St
104104
</div>
105105
</div>
106106
<div className='studio-single-test-attempts' ref={containerRef}>
107-
<Attempts test={currentTest} scrollIntoView={scrollIntoView} />
107+
<Attempts isSingleStudioTest test={currentTest} scrollIntoView={scrollIntoView} />
108108
</div>
109109
</div>
110110
)

0 commit comments

Comments
 (0)