How to add two data attribute check in cypress?

Viewed 7949

Ex:

<div data-component="tab" data-value="first_tab">
</div>

How can I get data-component="tab" and data-value="first_tab" together in cypress command? Like I want to access select box inside first_tab and I want to be more context specific and write a more readable code: What I have tried is below (which is syntactically wrong)

cy.get('[data-component="tab" data-value="first_tab"] [data-component="select_box"]').click()
2 Answers
Related