From 02d9a8a8e8cfd499208de3be515c6d38b12aa0c2 Mon Sep 17 00:00:00 2001 From: Calson Chiatiah Date: Thu, 22 Feb 2024 10:11:56 +0100 Subject: [PATCH] test(ui/QDate): add years-in-month-view prop test --- ui/src/components/date/__tests__/QDate.cy.js | 23 ++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/ui/src/components/date/__tests__/QDate.cy.js b/ui/src/components/date/__tests__/QDate.cy.js index b5782b2a191e..ef6564188063 100644 --- a/ui/src/components/date/__tests__/QDate.cy.js +++ b/ui/src/components/date/__tests__/QDate.cy.js @@ -13,8 +13,27 @@ describe('Date API', () => { describe('Props', () => { describe('Category: behavior', () => { describe('(prop): years-in-month-view', () => { - it.skip(' ', () => { - // + it('should show the years selector in months view', () => { + const model = ref('2018/06/03') + + mountQDate({ + props: { + ...vModelAdapter(model), + defaultView: 'Months', + yearsInMonthView: true + } + }) + + cy.get('.q-date__months .bg-primary') + .should('contain', 'Jun') + cy.get('.q-date__months') + .should('contain', '2018') + .then(async () => { + await Cypress.vueWrapper.setProps({ yearsInMonthView: false }) + }) + + cy.get('.q-date__months') + .should('not.contain', '2018') }) }) })