|
1 | 1 | import { submitMessage } from '../../support/testUtils'; |
2 | 2 |
|
3 | 3 | describe('Step with Icon', () => { |
4 | | - it('should be able to use steps with icons', () => { |
| 4 | + it('should display icons for steps with icon property', () => { |
5 | 5 | submitMessage('Hello'); |
6 | 6 |
|
7 | | - cy.get('#step-search').should('exist').click(); |
| 7 | + cy.get('.step').should('have.length', 5); |
8 | 8 |
|
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 | + }); |
10 | 19 |
|
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 | + }); |
12 | 26 |
|
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 | + }); |
14 | 34 |
|
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 | + }); |
16 | 41 | }); |
17 | 42 | }); |
0 commit comments