Skip to content

Commit 2d011b0

Browse files
committed
test: add tests for textareaAttributes and textareaAttributes
1 parent e854daa commit 2d011b0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/tests/base-input.cy.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,17 @@ describe('<BaseInput />', () => {
221221
cy.get(textareaSelector).type(newText)
222222
cy.get(textareaSelector).should('have.value', newText)
223223
})
224+
225+
it('should apply inputAttributes to input', () => {
226+
mount(BaseInput, {props: {inputAttributes: {placeholder: defaultPlaceholderText, id: '123'}}})
227+
228+
cy.get(inputSelector).should('have.attr', 'placeholder', defaultPlaceholderText).and('have.attr', 'id', '123')
229+
})
230+
231+
it('should apply textareaAttributes to textarea', () => {
232+
mount(BaseInput, {props: {textarea: true, textareaAttributes: {placeholder: defaultPlaceholderText, id: '123', rows: 10}}})
233+
234+
cy.get(textareaSelector).should('have.attr', 'placeholder', defaultPlaceholderText).and('have.attr', 'id', '123').and('have.attr', 'rows', '10')
235+
})
224236
})
225237

0 commit comments

Comments
 (0)