Skip to content

Commit d5324a1

Browse files
author
Allaoua Benchikh
committed
Improved tests
1 parent 4dd76e2 commit d5324a1

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

cypress/e2e/step_icon/spec.cy.ts

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,42 @@
11
import { submitMessage } from '../../support/testUtils';
22

33
describe('Step with Icon', () => {
4-
it('should be able to use steps with icons', () => {
4+
it('should display icons for steps with icon property', () => {
55
submitMessage('Hello');
66

7-
cy.get('#step-search').should('exist').click();
7+
cy.get('.step').should('have.length', 5);
88

9-
cy.get('#step-database').should('exist').click();
9+
// Check that steps with icons have SVG icons (not avatar images)
10+
// The avatar is a sibling of the step content in the .ai-message container
11+
cy.get('#step-search')
12+
.closest('.ai-message')
13+
.within(() => {
14+
// Should have an svg icon (Lucide icons are SVGs)
15+
cy.get('svg').should('exist');
16+
// Should NOT have an avatar image
17+
cy.get('img').should('not.exist');
18+
});
1019

11-
cy.get('#step-regular').should('exist').click();
20+
cy.get('#step-database')
21+
.closest('.ai-message')
22+
.within(() => {
23+
cy.get('svg').should('exist');
24+
cy.get('img').should('not.exist');
25+
});
1226

13-
cy.get('#step-cpu').should('exist');
27+
// Check that step without icon has avatar (image)
28+
cy.get('#step-regular')
29+
.closest('.ai-message')
30+
.within(() => {
31+
// Should have an avatar image
32+
cy.get('img').should('exist');
33+
});
1434

15-
cy.get('.step').should('have.length', 5);
35+
cy.get('#step-cpu')
36+
.closest('.ai-message')
37+
.within(() => {
38+
cy.get('svg').should('exist');
39+
cy.get('img').should('not.exist');
40+
});
1641
});
1742
});

0 commit comments

Comments
 (0)