Skip to content

Commit

Permalink
add cypress test for list component
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-deshmukh committed Oct 20, 2023
1 parent 0239331 commit 4acdcb2
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions src/components/List/List.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
import React from 'react';
import List from './index';

describe('List', () => {
it('TODO', () => {
expect(true).to.equal(true);
it('test list is rendered with items in primary theme', () => {
cy.mount(
<List
theme="primary-light"
label="LABEL"
>
<List.Item>Alpha</List.Item>
<List.Item>Bravo</List.Item>
<List.Item>Charlie</List.Item>
<List.Item>Delta</List.Item>
</List>
)

cy.get('.tyk-list__wrapper')
.get('ul')
.should('have.class', 'tyk-list')

cy.contains("LABEL").should('exist');
cy.contains("Alpha").should('exist');
cy.contains("Bravo").should('exist');
cy.contains("Charlie").should('exist');
cy.contains("Delta").should('exist');
});
});
});

0 comments on commit 4acdcb2

Please sign in to comment.