Skip to content

Commit

Permalink
fix: lost data-testid on plaintext config card items (#866)
Browse files Browse the repository at this point in the history
* fix: lost data-testid on plaintext config card items

* fix: add test
  • Loading branch information
filipgutica committed Oct 24, 2023
1 parent 7cacb63 commit 95550c3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,24 @@ describe('<ConfigCardItem />', () => {
cy.getTestId(`${item.key}-external-link`).should('contain.text', link)
cy.get(`a[href="${link}"]`).should('exist')
})

it('plaintext config card item has data-testid', () => {
const item: RecordItem = {
type: ConfigurationSchemaType.Text,
key: 'textItem',
label: 'textItem',
value: 'asdf',
}

cy.mount(ConfigCardItem, {
props: {
item,
},
})

cy.get('[data-testid="textItem-plain-text"]').should('exist')
cy.get('[data-testid="textItem-plain-text"]').should('contain.text', 'asdf')
})
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ const componentAttrsData = computed((): ComponentAttrsData => {
default:
return {
tag: 'div',
tag: 'KTooltip',
attrs: {
'data-testid': `${props.item.key}-plain-text`,
},
Expand Down

0 comments on commit 95550c3

Please sign in to comment.