quasar 2.17.6 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/QBtnDropdown.json +1 -1
- package/dist/api/QDialog.json +1 -1
- package/dist/api/QMenu.json +1 -1
- package/dist/api/QOptionGroup.json +1 -1
- package/dist/api/QSelect.json +1 -1
- package/dist/api/QTable.json +1 -1
- package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/material-icons.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v7.umd.prod.js +1 -1
- package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-rounded.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-symbols-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v7.umd.prod.js +1 -1
- package/dist/icon-set/svg-themify.umd.prod.js +1 -1
- package/dist/icon-set/themify.umd.prod.js +1 -1
- package/dist/lang/ar-TN.umd.prod.js +2 -2
- package/dist/lang/ar.umd.prod.js +2 -2
- package/dist/lang/az-Latn.umd.prod.js +2 -2
- package/dist/lang/bg.umd.prod.js +2 -2
- package/dist/lang/bn.umd.prod.js +2 -2
- package/dist/lang/bs-BA.umd.prod.js +2 -2
- package/dist/lang/ca.umd.prod.js +2 -2
- package/dist/lang/cs.umd.prod.js +2 -2
- package/dist/lang/da.umd.prod.js +2 -2
- package/dist/lang/de-CH.umd.prod.js +2 -2
- package/dist/lang/de-DE.umd.prod.js +2 -2
- package/dist/lang/de.umd.prod.js +2 -2
- package/dist/lang/el.umd.prod.js +2 -2
- package/dist/lang/en-GB.umd.prod.js +2 -2
- package/dist/lang/en-US.umd.prod.js +2 -2
- package/dist/lang/eo.umd.prod.js +2 -2
- package/dist/lang/es.umd.prod.js +2 -2
- package/dist/lang/et.umd.prod.js +2 -2
- package/dist/lang/eu.umd.prod.js +2 -2
- package/dist/lang/fa-IR.umd.prod.js +2 -2
- package/dist/lang/fa.umd.prod.js +2 -2
- package/dist/lang/fi.umd.prod.js +2 -2
- package/dist/lang/fr.umd.prod.js +2 -2
- package/dist/lang/gn.umd.prod.js +2 -2
- package/dist/lang/he.umd.prod.js +2 -2
- package/dist/lang/hi.umd.prod.js +2 -2
- package/dist/lang/hr.umd.prod.js +2 -2
- package/dist/lang/hu.umd.prod.js +2 -2
- package/dist/lang/id.umd.prod.js +2 -2
- package/dist/lang/is.umd.prod.js +2 -2
- package/dist/lang/it.umd.prod.js +2 -2
- package/dist/lang/ja.umd.prod.js +2 -2
- package/dist/lang/kk.umd.prod.js +2 -2
- package/dist/lang/km.umd.prod.js +2 -2
- package/dist/lang/ko-KR.umd.prod.js +2 -2
- package/dist/lang/kur-CKB.umd.prod.js +2 -2
- package/dist/lang/lt.umd.prod.js +2 -2
- package/dist/lang/lu.umd.prod.js +2 -2
- package/dist/lang/lv.umd.prod.js +2 -2
- package/dist/lang/mk.umd.prod.js +2 -2
- package/dist/lang/ml.umd.prod.js +2 -2
- package/dist/lang/mm.umd.prod.js +2 -2
- package/dist/lang/ms-MY.umd.prod.js +2 -2
- package/dist/lang/ms.umd.prod.js +2 -2
- package/dist/lang/my.umd.prod.js +2 -2
- package/dist/lang/nb-NO.umd.prod.js +2 -2
- package/dist/lang/nl.umd.prod.js +2 -2
- package/dist/lang/pl.umd.prod.js +2 -2
- package/dist/lang/pt-BR.umd.prod.js +2 -2
- package/dist/lang/pt.umd.prod.js +2 -2
- package/dist/lang/ro.umd.prod.js +2 -2
- package/dist/lang/ru.umd.prod.js +2 -2
- package/dist/lang/sk.umd.prod.js +2 -2
- package/dist/lang/sl.umd.prod.js +2 -2
- package/dist/lang/sm.umd.prod.js +2 -2
- package/dist/lang/sr-CYR.umd.prod.js +2 -2
- package/dist/lang/sr.umd.prod.js +2 -2
- package/dist/lang/sv.umd.prod.js +2 -2
- package/dist/lang/ta.umd.prod.js +2 -2
- package/dist/lang/th.umd.prod.js +2 -2
- package/dist/lang/tl.umd.prod.js +2 -2
- package/dist/lang/tr.umd.prod.js +2 -2
- package/dist/lang/ug.umd.prod.js +1 -1
- package/dist/lang/uk.umd.prod.js +2 -2
- package/dist/lang/ur-PK.umd.prod.js +7 -0
- package/dist/lang/uz-Cyrl.umd.prod.js +2 -2
- package/dist/lang/uz-Latn.umd.prod.js +2 -2
- package/dist/lang/vi.umd.prod.js +2 -2
- package/dist/lang/zh-CN.umd.prod.js +2 -2
- package/dist/lang/zh-TW.umd.prod.js +2 -2
- package/dist/quasar.client.js +252 -179
- package/dist/quasar.css +1 -1
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +1 -1
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +2 -2
- package/dist/quasar.server.prod.cjs +36 -36
- package/dist/quasar.server.prod.js +37 -37
- package/dist/quasar.umd.js +252 -179
- package/dist/quasar.umd.prod.js +42 -42
- package/dist/types/index.d.ts +86 -17
- package/dist/vetur/quasar-attributes.json +1 -1
- package/dist/vetur/quasar-tags.json +1 -1
- package/dist/web-types/web-types.json +1 -1
- package/lang/ar-TN.js +6 -0
- package/lang/ar.js +6 -0
- package/lang/az-Latn.js +6 -0
- package/lang/bg.js +6 -0
- package/lang/bn.js +6 -0
- package/lang/bs-BA.js +6 -0
- package/lang/ca.js +6 -0
- package/lang/cs.js +6 -0
- package/lang/da.js +6 -0
- package/lang/de-CH.js +6 -0
- package/lang/de-DE.js +6 -0
- package/lang/de.js +6 -0
- package/lang/el.js +6 -0
- package/lang/en-GB.js +6 -0
- package/lang/en-US.js +6 -0
- package/lang/eo.js +6 -0
- package/lang/es.js +6 -0
- package/lang/et.js +6 -0
- package/lang/eu.js +6 -0
- package/lang/fa-IR.js +6 -0
- package/lang/fa.js +6 -0
- package/lang/fi.js +6 -0
- package/lang/fr.js +6 -0
- package/lang/gn.js +6 -0
- package/lang/he.js +6 -0
- package/lang/hi.js +6 -0
- package/lang/hr.js +6 -0
- package/lang/hu.js +6 -0
- package/lang/id.js +6 -0
- package/lang/index.json +1 -1
- package/lang/is.js +6 -0
- package/lang/it.js +6 -0
- package/lang/ja.js +6 -0
- package/lang/kk.js +6 -0
- package/lang/km.js +6 -0
- package/lang/ko-KR.js +6 -0
- package/lang/kur-CKB.js +6 -0
- package/lang/lt.js +6 -0
- package/lang/lu.js +6 -0
- package/lang/lv.js +6 -0
- package/lang/mk.js +6 -0
- package/lang/ml.js +6 -0
- package/lang/mm.js +6 -0
- package/lang/ms-MY.js +6 -0
- package/lang/ms.js +6 -0
- package/lang/my.js +6 -0
- package/lang/nb-NO.js +6 -0
- package/lang/nl.js +6 -0
- package/lang/pl.js +6 -0
- package/lang/pt-BR.js +6 -0
- package/lang/pt.js +6 -0
- package/lang/ro.js +6 -0
- package/lang/ru.js +6 -0
- package/lang/sk.js +6 -0
- package/lang/sl.js +6 -0
- package/lang/sm.js +6 -0
- package/lang/sr-CYR.js +6 -0
- package/lang/sr.js +6 -0
- package/lang/sv.js +6 -0
- package/lang/ta.js +6 -0
- package/lang/th.js +6 -0
- package/lang/tl.js +6 -0
- package/lang/tr.js +6 -0
- package/lang/uk.js +6 -0
- package/lang/ur-PK.js +111 -0
- package/lang/uz-Cyrl.js +6 -0
- package/lang/uz-Latn.js +6 -0
- package/lang/vi.js +6 -0
- package/lang/zh-CN.js +6 -0
- package/lang/zh-TW.js +6 -0
- package/package.json +4 -4
- package/src/components/breadcrumbs/QBreadcrumbs.js +2 -2
- package/src/components/btn/QBtn.js +7 -8
- package/src/components/btn-dropdown/QBtnDropdown.js +10 -4
- package/src/components/btn-dropdown/QBtnDropdown.json +21 -0
- package/src/components/color/QColor.js +1 -1
- package/src/components/date/QDate.js +14 -7
- package/src/components/dialog/QDialog.js +2 -2
- package/src/components/dialog/QDialog.json +1 -1
- package/src/components/drawer/QDrawer.js +3 -5
- package/src/components/editor/QEditor.js +1 -1
- package/src/components/editor/editor-caret.js +1 -1
- package/src/components/editor/editor-utils.js +2 -2
- package/src/components/expansion-item/QExpansionItem.js +6 -3
- package/src/components/fab/QFab.js +2 -2
- package/src/components/form/QForm.js +2 -2
- package/src/components/form/QFormChildMixin.js +6 -4
- package/src/components/icon/QIcon.js +2 -2
- package/src/components/infinite-scroll/QInfiniteScroll.js +2 -4
- package/src/components/input/QInput.js +3 -3
- package/src/components/item/QItem.js +1 -1
- package/src/components/menu/QMenu.js +8 -5
- package/src/components/menu/QMenu.json +8 -1
- package/src/components/option-group/QOptionGroup.json +1 -17
- package/src/components/pagination/QPagination.js +8 -4
- package/src/components/parallax/QParallax.js +1 -1
- package/src/components/popup-edit/QPopupEdit.js +2 -2
- package/src/components/pull-to-refresh/QPullToRefresh.js +1 -1
- package/src/components/rating/QRating.sass +1 -1
- package/src/components/resize-observer/QResizeObserver.js +1 -1
- package/src/components/scroll-observer/QScrollObserver.js +2 -2
- package/src/components/select/QSelect.js +8 -6
- package/src/components/select/QSelect.json +2 -2
- package/src/components/slide-transition/QSlideTransition.js +2 -2
- package/src/components/stepper/StepHeader.js +1 -1
- package/src/components/table/QTable.js +84 -36
- package/src/components/table/QTable.json +138 -0
- package/src/components/table/QTr.js +4 -1
- package/src/components/table/table-sort.js +1 -1
- package/src/components/tabs/QTabs.js +2 -2
- package/src/components/tabs/use-tab.js +4 -4
- package/src/components/time/QTime.js +1 -1
- package/src/components/tree/QTree.js +2 -3
- package/src/components/virtual-scroll/use-virtual-scroll.js +3 -3
- package/src/composables/private.use-field/use-field.js +5 -5
- package/src/composables/private.use-file/use-file.js +6 -3
- package/src/composables/private.use-model-toggle/use-model-toggle.js +2 -2
- package/src/composables/private.use-refocus-target/use-refocus-target.js +6 -5
- package/src/composables/private.use-validate/use-validate.js +1 -1
- package/src/directives/intersection/Intersection.js +2 -2
- package/src/directives/morph/Morph.js +2 -2
- package/src/directives/mutation/Mutation.js +2 -2
- package/src/directives/touch-hold/TouchHold.js +2 -2
- package/src/directives/touch-pan/TouchPan.js +2 -2
- package/src/directives/touch-repeat/TouchRepeat.js +3 -3
- package/src/directives/touch-swipe/TouchSwipe.js +3 -3
- package/src/plugins/lang/Lang.test.js +12 -0
- package/src/plugins/loading/Loading.js +1 -1
- package/src/plugins/notify/Notify.js +1 -1
- package/src/plugins/private.body/Body.js +1 -1
- package/src/plugins/private.history/History.js +1 -1
- package/src/plugins/screen/Screen.js +1 -1
- package/src/utils/morph/morph.js +13 -10
- package/src/utils/open-url/open-url.js +3 -3
- package/src/utils/private.dialog/create-dialog.js +2 -2
- package/src/utils/private.portal/portal.js +1 -1
- package/src/components/date/__tests__/QDate.cy.js +0 -189
- package/src/components/date/__tests__/use-datetime.cy.js +0 -83
- package/src/components/editor/__tests__/QEditor.cy.js +0 -195
- package/src/components/field/__tests__/QField.cy.js +0 -156
- package/src/components/input/__tests__/QInput.cy.js +0 -786
- package/src/components/input/__tests__/use-mask.cy.js +0 -124
- package/src/components/menu/__tests__/QMenu.cy.js +0 -634
- package/src/components/menu/__tests__/WrapperOne.vue +0 -51
- package/src/components/menu/__tests__/WrapperTwo.vue +0 -38
- package/src/components/select/__tests__/QSelect.cy.js +0 -2018
- package/src/components/table/__tests__/QTable.cy.js +0 -635
- package/src/components/table/__tests__/QTd.cy.js +0 -35
- package/src/components/table/__tests__/QTh.cy.js +0 -27
- package/src/components/table/__tests__/QTr.cy.js +0 -27
- package/src/components/tabs/__tests__/QTab.cy.js +0 -79
- package/src/components/tabs/__tests__/QTabs.cy.js +0 -147
- package/src/components/uploader/__tests__/QUploader.cy.js +0 -191
- package/src/composables/__tests__/FieldWrapper.vue +0 -54
- package/src/composables/__tests__/use-anchor.cy.js +0 -98
- package/src/composables/__tests__/use-field.cy.js +0 -547
- package/src/composables/__tests__/use-file.cy.js +0 -69
- package/src/composables/__tests__/use-fullscreen.cy.js +0 -37
- package/src/composables/__tests__/use-model-toggle.cy.js +0 -350
- package/src/composables/__tests__/use-portal.cy.js +0 -4
- package/src/composables/__tests__/use-router-link.cy.js +0 -55
- package/src/composables/__tests__/use-validate.cy.js +0 -257
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-unused-expressions */
|
|
2
|
-
import { vModelAdapter } from '@quasar/quasar-app-extension-testing-e2e-cypress'
|
|
3
|
-
import { ref } from 'vue'
|
|
4
|
-
import WrapperOne from '../../../components/menu/__tests__/WrapperOne.vue'
|
|
5
|
-
import WrapperTwo from '../../../components/menu/__tests__/WrapperTwo.vue'
|
|
6
|
-
|
|
7
|
-
describe('use-model-toggle API', () => {
|
|
8
|
-
describe('Props', () => {
|
|
9
|
-
describe('Category: model', () => {
|
|
10
|
-
describe('(prop): model-value', () => {
|
|
11
|
-
it('should open the dialog when modifying the model-value', () => {
|
|
12
|
-
const model = ref(false)
|
|
13
|
-
cy.mount(WrapperOne, {
|
|
14
|
-
props: {
|
|
15
|
-
...vModelAdapter(model)
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
cy.dataCy('wrapper')
|
|
19
|
-
cy.dataCy('menu')
|
|
20
|
-
.should('not.exist')
|
|
21
|
-
.then(() => {
|
|
22
|
-
model.value = true
|
|
23
|
-
cy.dataCy('menu')
|
|
24
|
-
.should('exist')
|
|
25
|
-
})
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('should close the dialog when modifying the model-value', () => {
|
|
29
|
-
const model = ref(true)
|
|
30
|
-
cy.mount(WrapperOne, {
|
|
31
|
-
props: {
|
|
32
|
-
...vModelAdapter(model)
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
cy.dataCy('wrapper')
|
|
36
|
-
cy.dataCy('menu')
|
|
37
|
-
.should('exist')
|
|
38
|
-
.then(() => {
|
|
39
|
-
model.value = false
|
|
40
|
-
cy.dataCy('menu')
|
|
41
|
-
.should('not.exist')
|
|
42
|
-
})
|
|
43
|
-
})
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
describe('Events', () => {
|
|
49
|
-
describe('(event): update:model-value', () => {
|
|
50
|
-
it('should emit @update:model-value event when state changes', () => {
|
|
51
|
-
const fn = cy.stub()
|
|
52
|
-
cy.mount(WrapperOne, {
|
|
53
|
-
props: {
|
|
54
|
-
'onUpdate:modelValue': fn
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
expect(fn).not.to.be.called
|
|
59
|
-
cy.dataCy('wrapper')
|
|
60
|
-
.click()
|
|
61
|
-
cy.dataCy('menu')
|
|
62
|
-
.should('exist')
|
|
63
|
-
.then(() => {
|
|
64
|
-
expect(fn).to.be.called
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
describe('(event): show', () => {
|
|
70
|
-
it('should emit @show event when menu is triggered by parent', () => {
|
|
71
|
-
const fn = cy.stub()
|
|
72
|
-
cy.mount(WrapperOne, {
|
|
73
|
-
props: {
|
|
74
|
-
onShow: fn
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
expect(fn).not.to.be.called
|
|
79
|
-
cy.dataCy('wrapper')
|
|
80
|
-
.click()
|
|
81
|
-
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
82
|
-
cy.dataCy('menu')
|
|
83
|
-
.should('exist')
|
|
84
|
-
.wait(300) // Await menu animation
|
|
85
|
-
.then(() => {
|
|
86
|
-
expect(fn).to.be.called
|
|
87
|
-
})
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
it('should emit @show event when component is triggered with the show() method', () => {
|
|
91
|
-
const fn = cy.stub()
|
|
92
|
-
cy.mount(WrapperOne, {
|
|
93
|
-
props: {
|
|
94
|
-
onShow: fn
|
|
95
|
-
}
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
expect(fn).not.to.be.called
|
|
99
|
-
cy.dataCy('wrapper')
|
|
100
|
-
cy.dataCy('method-show')
|
|
101
|
-
.click({ force: true }) // Element is hidden to prevent clogging the window
|
|
102
|
-
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
103
|
-
cy.dataCy('menu')
|
|
104
|
-
.should('exist')
|
|
105
|
-
.wait(300) // Await menu animation
|
|
106
|
-
.then(() => {
|
|
107
|
-
expect(fn).to.be.called
|
|
108
|
-
})
|
|
109
|
-
})
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
describe('(event): before-show', () => {
|
|
113
|
-
it('should emit @before-show event when menu is triggered by parent', () => {
|
|
114
|
-
const fn = cy.stub()
|
|
115
|
-
cy.mount(WrapperOne, {
|
|
116
|
-
props: {
|
|
117
|
-
onBeforeShow: fn
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
expect(fn).not.to.be.called
|
|
122
|
-
cy.dataCy('wrapper')
|
|
123
|
-
.click()
|
|
124
|
-
cy.dataCy('menu')
|
|
125
|
-
.should('exist')
|
|
126
|
-
.then(() => {
|
|
127
|
-
expect(fn).to.be.called
|
|
128
|
-
})
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
it('should emit @before-show event when component is triggered with the show() method', () => {
|
|
132
|
-
const fn = cy.stub()
|
|
133
|
-
cy.mount(WrapperOne, {
|
|
134
|
-
props: {
|
|
135
|
-
onBeforeShow: fn
|
|
136
|
-
}
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
expect(fn).not.to.be.called
|
|
140
|
-
cy.dataCy('wrapper')
|
|
141
|
-
cy.dataCy('method-show')
|
|
142
|
-
.click({ force: true }) // Element is hidden to prevent clogging the window
|
|
143
|
-
cy.dataCy('menu')
|
|
144
|
-
.should('exist')
|
|
145
|
-
.then(() => {
|
|
146
|
-
expect(fn).to.be.called
|
|
147
|
-
})
|
|
148
|
-
})
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
describe('(event): hide', () => {
|
|
152
|
-
it('should emit @hide event when menu is triggered by parent', () => {
|
|
153
|
-
const fn = cy.stub()
|
|
154
|
-
cy.mount(WrapperOne, {
|
|
155
|
-
props: {
|
|
156
|
-
onHide: fn,
|
|
157
|
-
// After the dialog has been closed, the hide event is fired only after transitionDuration.
|
|
158
|
-
// The default value for transitionDuration is 300ms. Hence, we cannot depend on the dialog closing
|
|
159
|
-
// to conclude that the event has been fired. So let's set it to 0 so that it fires immediately.
|
|
160
|
-
transitionDuration: 0
|
|
161
|
-
}
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
expect(fn).not.to.be.called
|
|
165
|
-
cy.dataCy('wrapper')
|
|
166
|
-
.click()
|
|
167
|
-
cy.dataCy('menu')
|
|
168
|
-
.should('exist')
|
|
169
|
-
.then(() => {
|
|
170
|
-
expect(fn).not.to.be.called
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
// We are clicking x distance from the left to ensure it always clicks on the body
|
|
174
|
-
// For some reason it some times does not work without it
|
|
175
|
-
cy.get('body')
|
|
176
|
-
.click(499, 0)
|
|
177
|
-
cy.dataCy('menu')
|
|
178
|
-
.should('not.exist')
|
|
179
|
-
.then(() => {
|
|
180
|
-
expect(fn).to.be.called
|
|
181
|
-
})
|
|
182
|
-
})
|
|
183
|
-
|
|
184
|
-
it('should emit @hide event when component is triggered with the hide() method', () => {
|
|
185
|
-
const fn = cy.stub()
|
|
186
|
-
cy.mount(WrapperOne, {
|
|
187
|
-
props: {
|
|
188
|
-
onHide: fn,
|
|
189
|
-
// After the dialog has been closed, the hide event is fired only after transitionDuration.
|
|
190
|
-
// The default value for transitionDuration is 300ms. Hence, we cannot depend on the dialog closing
|
|
191
|
-
// to conclude that the event has been fired. So let's set it to 0 so that it fires immediately.
|
|
192
|
-
transitionDuration: 0
|
|
193
|
-
}
|
|
194
|
-
})
|
|
195
|
-
|
|
196
|
-
expect(fn).not.to.be.called
|
|
197
|
-
cy.dataCy('wrapper')
|
|
198
|
-
cy.dataCy('method-show')
|
|
199
|
-
.click({ force: true }) // Element is hidden to prevent clogging the window
|
|
200
|
-
cy.dataCy('menu')
|
|
201
|
-
.should('exist')
|
|
202
|
-
.then(() => {
|
|
203
|
-
expect(fn).not.to.be.called
|
|
204
|
-
})
|
|
205
|
-
cy.dataCy('method-hide')
|
|
206
|
-
.click({ force: true })
|
|
207
|
-
cy.dataCy('menu')
|
|
208
|
-
.should('not.exist') // Element is hidden to prevent clogging the window
|
|
209
|
-
.then(() => {
|
|
210
|
-
expect(fn).to.be.called
|
|
211
|
-
})
|
|
212
|
-
})
|
|
213
|
-
|
|
214
|
-
it('should emit @hide event after transition duration', () => {
|
|
215
|
-
const fn = cy.stub()
|
|
216
|
-
cy.mount(WrapperOne, {
|
|
217
|
-
props: {
|
|
218
|
-
onHide: fn,
|
|
219
|
-
transitionDuration: 500
|
|
220
|
-
}
|
|
221
|
-
})
|
|
222
|
-
|
|
223
|
-
expect(fn).not.to.be.called
|
|
224
|
-
cy.dataCy('method-show')
|
|
225
|
-
.click({ force: true })
|
|
226
|
-
|
|
227
|
-
cy.dataCy('wrapper')
|
|
228
|
-
cy.dataCy('method-hide')
|
|
229
|
-
.click({ force: true })
|
|
230
|
-
|
|
231
|
-
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
232
|
-
cy.dataCy('menu')
|
|
233
|
-
.wait(300)
|
|
234
|
-
.then(() => {
|
|
235
|
-
expect(fn).not.to.be.called
|
|
236
|
-
})
|
|
237
|
-
.wait(500)
|
|
238
|
-
.then(() => {
|
|
239
|
-
expect(fn).to.be.called
|
|
240
|
-
})
|
|
241
|
-
})
|
|
242
|
-
})
|
|
243
|
-
|
|
244
|
-
describe('(event): before-hide', () => {
|
|
245
|
-
it('should emit @before-hide event when menu is triggered by parent', () => {
|
|
246
|
-
const fn = cy.stub()
|
|
247
|
-
cy.mount(WrapperOne, {
|
|
248
|
-
props: {
|
|
249
|
-
onBeforeHide: fn
|
|
250
|
-
}
|
|
251
|
-
})
|
|
252
|
-
|
|
253
|
-
expect(fn).not.to.be.called
|
|
254
|
-
cy.dataCy('wrapper')
|
|
255
|
-
.click()
|
|
256
|
-
cy.dataCy('menu')
|
|
257
|
-
.should('exist')
|
|
258
|
-
.then(() => {
|
|
259
|
-
expect(fn).not.to.be.called
|
|
260
|
-
})
|
|
261
|
-
cy.get('body')
|
|
262
|
-
.click(499, 0)
|
|
263
|
-
cy.get('body')
|
|
264
|
-
.then(() => {
|
|
265
|
-
expect(fn).to.be.called
|
|
266
|
-
})
|
|
267
|
-
cy.dataCy('menu')
|
|
268
|
-
.should('not.exist')
|
|
269
|
-
})
|
|
270
|
-
|
|
271
|
-
it('should emit @before-hide event when component is triggered with the show() method', () => {
|
|
272
|
-
const fn = cy.stub()
|
|
273
|
-
cy.mount(WrapperOne, {
|
|
274
|
-
props: {
|
|
275
|
-
onBeforeHide: fn
|
|
276
|
-
}
|
|
277
|
-
})
|
|
278
|
-
|
|
279
|
-
expect(fn).not.to.be.called
|
|
280
|
-
cy.dataCy('wrapper')
|
|
281
|
-
cy.dataCy('method-show')
|
|
282
|
-
.click({ force: true }) // Element is hidden to prevent clogging the window
|
|
283
|
-
cy.dataCy('menu')
|
|
284
|
-
.should('exist')
|
|
285
|
-
.then(() => {
|
|
286
|
-
expect(fn).not.to.be.called
|
|
287
|
-
})
|
|
288
|
-
cy.dataCy('method-hide')
|
|
289
|
-
.click({ force: true })
|
|
290
|
-
cy.dataCy('method-hide')
|
|
291
|
-
.then(() => {
|
|
292
|
-
expect(fn).to.be.called
|
|
293
|
-
})
|
|
294
|
-
cy.dataCy('menu')
|
|
295
|
-
.should('not.exist')
|
|
296
|
-
})
|
|
297
|
-
})
|
|
298
|
-
})
|
|
299
|
-
|
|
300
|
-
describe('Methods', () => {
|
|
301
|
-
describe('(method): show', () => {
|
|
302
|
-
it('should trigger the menu to show', () => {
|
|
303
|
-
cy.mount(WrapperOne)
|
|
304
|
-
|
|
305
|
-
cy.dataCy('wrapper')
|
|
306
|
-
cy.dataCy('method-show')
|
|
307
|
-
.click({ force: true })
|
|
308
|
-
cy.dataCy('menu')
|
|
309
|
-
.should('exist')
|
|
310
|
-
})
|
|
311
|
-
})
|
|
312
|
-
|
|
313
|
-
describe('(method): hide', () => {
|
|
314
|
-
it('should trigger the menu to hide', () => {
|
|
315
|
-
cy.mount(WrapperOne)
|
|
316
|
-
|
|
317
|
-
cy.dataCy('wrapper')
|
|
318
|
-
.click()
|
|
319
|
-
cy.dataCy('menu')
|
|
320
|
-
.should('exist')
|
|
321
|
-
cy.dataCy('method-hide')
|
|
322
|
-
.click({ force: true })
|
|
323
|
-
cy.dataCy('menu')
|
|
324
|
-
.should('not.exist')
|
|
325
|
-
})
|
|
326
|
-
})
|
|
327
|
-
|
|
328
|
-
describe('(method): toggle', () => {
|
|
329
|
-
it('should toggle the menu', () => {
|
|
330
|
-
cy.mount(WrapperTwo)
|
|
331
|
-
|
|
332
|
-
cy.dataCy('wrapper')
|
|
333
|
-
.then(() => {
|
|
334
|
-
// Need to call method from wrapper
|
|
335
|
-
// Click a button closes the menu
|
|
336
|
-
Cypress.vueWrapper.vm.toggle()
|
|
337
|
-
})
|
|
338
|
-
cy.dataCy('menu')
|
|
339
|
-
.should('exist')
|
|
340
|
-
.then(() => {
|
|
341
|
-
// Need to call method from wrapper
|
|
342
|
-
// Click a button closes the menu
|
|
343
|
-
Cypress.vueWrapper.vm.toggle()
|
|
344
|
-
})
|
|
345
|
-
cy.dataCy('menu')
|
|
346
|
-
.should('not.exist')
|
|
347
|
-
})
|
|
348
|
-
})
|
|
349
|
-
})
|
|
350
|
-
})
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
describe('use-router-link API', () => {
|
|
2
|
-
describe('Props', () => {
|
|
3
|
-
describe('Category: navigation', () => {
|
|
4
|
-
describe('(prop): to', () => {
|
|
5
|
-
it.skip(' ', () => {
|
|
6
|
-
//
|
|
7
|
-
})
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
describe('(prop): exact', () => {
|
|
11
|
-
it.skip(' ', () => {
|
|
12
|
-
//
|
|
13
|
-
})
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
describe('(prop): replace', () => {
|
|
17
|
-
it.skip(' ', () => {
|
|
18
|
-
//
|
|
19
|
-
})
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
describe('(prop): active-class', () => {
|
|
23
|
-
it.skip(' ', () => {
|
|
24
|
-
//
|
|
25
|
-
})
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
describe('(prop): exact-active-class', () => {
|
|
29
|
-
it.skip(' ', () => {
|
|
30
|
-
//
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
describe('(prop): href', () => {
|
|
35
|
-
it.skip(' ', () => {
|
|
36
|
-
//
|
|
37
|
-
})
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
describe('(prop): target', () => {
|
|
41
|
-
it.skip(' ', () => {
|
|
42
|
-
//
|
|
43
|
-
})
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
describe('Category: state', () => {
|
|
48
|
-
describe('(prop): disable', () => {
|
|
49
|
-
it.skip(' ', () => {
|
|
50
|
-
//
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
})
|
|
55
|
-
})
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import FieldWrapper from './FieldWrapper.vue'
|
|
2
|
-
import Icons from '../../../../icon-set/material-icons.mjs'
|
|
3
|
-
import { ref } from 'vue'
|
|
4
|
-
import { vModelAdapter } from '@quasar/quasar-app-extension-testing-e2e-cypress'
|
|
5
|
-
|
|
6
|
-
function mountQFieldWrapper (options) {
|
|
7
|
-
return cy.mount(FieldWrapper, options)
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function getHostElement () {
|
|
11
|
-
return cy.get('.select-root')
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
describe('use-validate API', () => {
|
|
15
|
-
describe('Props', () => {
|
|
16
|
-
describe('Category: behavior', () => {
|
|
17
|
-
describe('(prop): error', () => {
|
|
18
|
-
it('should mark the field as having an error', () => {
|
|
19
|
-
mountQFieldWrapper()
|
|
20
|
-
getHostElement().should('not.have.class', 'q-field--error')
|
|
21
|
-
|
|
22
|
-
getHostElement().then(() => {
|
|
23
|
-
Cypress.vueWrapper.setProps({ error: true })
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
getHostElement().should('have.class', 'q-field--error')
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
describe('(prop): rules', () => {
|
|
31
|
-
it('should validate value using custom validation logic', () => {
|
|
32
|
-
const errorMessage = 'Selected value should be greater than 10 characters'
|
|
33
|
-
const model = ref('Option 1')
|
|
34
|
-
const options = [ 'Option 1', 'Option 2' ]
|
|
35
|
-
|
|
36
|
-
mountQFieldWrapper({
|
|
37
|
-
props: {
|
|
38
|
-
...vModelAdapter(model),
|
|
39
|
-
options,
|
|
40
|
-
rules: [ val => val.length > 10 || errorMessage ]
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
getHostElement().then(() => {
|
|
45
|
-
model.value = 'Option 2'
|
|
46
|
-
})
|
|
47
|
-
getHostElement().get('.q-field__messages').should('contain.text', errorMessage)
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
it('should validate email using inbuilt validation logic', () => {
|
|
51
|
-
const errorMessage = 'Enter a valid email address'
|
|
52
|
-
const model = ref('Option 1')
|
|
53
|
-
const options = [ 'Option 1', 'Option 2' ]
|
|
54
|
-
mountQFieldWrapper({
|
|
55
|
-
props: {
|
|
56
|
-
...vModelAdapter(model),
|
|
57
|
-
options,
|
|
58
|
-
rules: [ (val, rules) => rules.email(val) || errorMessage ]
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
getHostElement().then(() => {
|
|
62
|
-
model.value = 'Option 2'
|
|
63
|
-
})
|
|
64
|
-
getHostElement().get('.q-field__messages').should('contain.text', errorMessage)
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
describe('(prop): reactive-rules', () => {
|
|
69
|
-
it('should trigger validation when there\'s a change of rules', () => {
|
|
70
|
-
const errorMessage = 'Error message'
|
|
71
|
-
const model = ref('Option 1')
|
|
72
|
-
const options = [ 'Option 1', 'Option 2' ]
|
|
73
|
-
mountQFieldWrapper({
|
|
74
|
-
props: {
|
|
75
|
-
...vModelAdapter(model),
|
|
76
|
-
options
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
getHostElement().then(() => {
|
|
81
|
-
Cypress.vueWrapper.setProps({ rules: [ (value) => value.length < 3 || errorMessage ] })
|
|
82
|
-
|
|
83
|
-
Cypress.vueWrapper.vm.focusMethod()
|
|
84
|
-
Cypress.vueWrapper.vm.blur()
|
|
85
|
-
})
|
|
86
|
-
getHostElement().get('.q-field__messages').should('not.exist')
|
|
87
|
-
|
|
88
|
-
getHostElement().then(() => {
|
|
89
|
-
Cypress.vueWrapper.setProps({ reactiveRules: true, rules: [ (value, rules) => rules.email(value) || errorMessage ] })
|
|
90
|
-
})
|
|
91
|
-
getHostElement().get('.q-field__messages').should('contain.text', errorMessage)
|
|
92
|
-
})
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
describe('(prop): lazy-rules', () => {
|
|
96
|
-
it('should validate the input only when component loses focus', () => {
|
|
97
|
-
const errorMessage = 'Use a max 3 of characters'
|
|
98
|
-
const model = ref('Option 1')
|
|
99
|
-
const options = [ 'Option 1', 'Option 2' ]
|
|
100
|
-
mountQFieldWrapper({
|
|
101
|
-
props: {
|
|
102
|
-
...vModelAdapter(model),
|
|
103
|
-
options,
|
|
104
|
-
lazyRules: true,
|
|
105
|
-
rules: [ () => errorMessage ]
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
getHostElement().select('Option 2')
|
|
110
|
-
getHostElement().get('.q-field__messages').should('not.contain', errorMessage)
|
|
111
|
-
|
|
112
|
-
getHostElement().then(() => {
|
|
113
|
-
Cypress.vueWrapper.vm.blur()
|
|
114
|
-
getHostElement().get('.q-field__messages').should('contain.text', errorMessage)
|
|
115
|
-
})
|
|
116
|
-
})
|
|
117
|
-
})
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
describe('Category: content', () => {
|
|
121
|
-
describe('(prop): error-message', () => {
|
|
122
|
-
it('should show an error-message when error is true', () => {
|
|
123
|
-
const message = 'Please select something'
|
|
124
|
-
cy.mount(FieldWrapper, {
|
|
125
|
-
props: {
|
|
126
|
-
error: true,
|
|
127
|
-
errorMessage: message
|
|
128
|
-
}
|
|
129
|
-
})
|
|
130
|
-
cy.get('.select-root')
|
|
131
|
-
.should('include.text', message)
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
it('should not show an error-message when error is false', () => {
|
|
135
|
-
const message = 'Please select something'
|
|
136
|
-
cy.mount(FieldWrapper, {
|
|
137
|
-
props: {
|
|
138
|
-
error: false,
|
|
139
|
-
errorMessage: message
|
|
140
|
-
}
|
|
141
|
-
})
|
|
142
|
-
cy.get('.select-root')
|
|
143
|
-
.should('not.include.text', message)
|
|
144
|
-
})
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
describe('(prop): no-error-icon', () => {
|
|
148
|
-
it('should not show an error icon when error is true', () => {
|
|
149
|
-
cy.mount(FieldWrapper, {
|
|
150
|
-
props: {
|
|
151
|
-
error: true,
|
|
152
|
-
noErrorIcon: true
|
|
153
|
-
}
|
|
154
|
-
})
|
|
155
|
-
cy.get('.select-root')
|
|
156
|
-
.get(`i:contains(${ Icons.field.error })`)
|
|
157
|
-
.should('not.exist')
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
it('should show an error icon when error is true an no-error-icon is false', () => {
|
|
161
|
-
cy.mount(FieldWrapper, {
|
|
162
|
-
props: {
|
|
163
|
-
error: true,
|
|
164
|
-
noErrorIcon: false
|
|
165
|
-
}
|
|
166
|
-
})
|
|
167
|
-
cy.get('.select-root')
|
|
168
|
-
.get(`i:contains(${ Icons.field.error })`)
|
|
169
|
-
.should('exist')
|
|
170
|
-
})
|
|
171
|
-
})
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
describe('Category: model', () => {
|
|
175
|
-
describe('(prop): model-value', () => {
|
|
176
|
-
it('should correctly update the model value', () => {
|
|
177
|
-
const model = ref()
|
|
178
|
-
const options = [ 'Option 1', 'Option 2' ]
|
|
179
|
-
mountQFieldWrapper({
|
|
180
|
-
props: {
|
|
181
|
-
...vModelAdapter(model),
|
|
182
|
-
options
|
|
183
|
-
}
|
|
184
|
-
})
|
|
185
|
-
getHostElement().get('input').should('not.have.value', options[ 0 ])
|
|
186
|
-
|
|
187
|
-
getHostElement().then(() => {
|
|
188
|
-
model.value = options[ 0 ]
|
|
189
|
-
})
|
|
190
|
-
|
|
191
|
-
getHostElement().get('input').should('have.value', options[ 0 ])
|
|
192
|
-
})
|
|
193
|
-
})
|
|
194
|
-
})
|
|
195
|
-
})
|
|
196
|
-
|
|
197
|
-
describe('Methods', () => {
|
|
198
|
-
describe('(method): resetValidation', () => {
|
|
199
|
-
it('should reset validation', () => {
|
|
200
|
-
const errorMessage = 'Use a max 3 of characters'
|
|
201
|
-
const model = ref('Option 1')
|
|
202
|
-
const options = [ 'Option 1', 'Option 2' ]
|
|
203
|
-
mountQFieldWrapper({
|
|
204
|
-
props: {
|
|
205
|
-
...vModelAdapter(model),
|
|
206
|
-
options,
|
|
207
|
-
rules: [ val => val.length <= 3 || errorMessage ],
|
|
208
|
-
lazyRules: 'ondemand'
|
|
209
|
-
}
|
|
210
|
-
})
|
|
211
|
-
|
|
212
|
-
getHostElement().then(() => {
|
|
213
|
-
model.value = 'Option 2'
|
|
214
|
-
})
|
|
215
|
-
getHostElement().get('.q-field__messages').should('not.contain', errorMessage)
|
|
216
|
-
|
|
217
|
-
getHostElement().then(() => {
|
|
218
|
-
Cypress.vueWrapper.vm.validate()
|
|
219
|
-
getHostElement().get('.q-field__messages').should('contain', errorMessage)
|
|
220
|
-
})
|
|
221
|
-
|
|
222
|
-
getHostElement().then(() => {
|
|
223
|
-
Cypress.vueWrapper.vm.resetValidation()
|
|
224
|
-
getHostElement().get('.q-field__messages').should('not.contain', errorMessage)
|
|
225
|
-
})
|
|
226
|
-
})
|
|
227
|
-
})
|
|
228
|
-
|
|
229
|
-
describe('(method): validate', () => {
|
|
230
|
-
it('should validate the input only when component\'s validate() method is called', () => {
|
|
231
|
-
const errorMessage = 'Use a max 3 of characters'
|
|
232
|
-
const model = ref('Option 1')
|
|
233
|
-
const options = [ 'Option 1', 'Option 2' ]
|
|
234
|
-
mountQFieldWrapper({
|
|
235
|
-
props: {
|
|
236
|
-
...vModelAdapter(model),
|
|
237
|
-
options,
|
|
238
|
-
rules: [ val => val.length <= 3 || errorMessage ],
|
|
239
|
-
lazyRules: 'ondemand'
|
|
240
|
-
}
|
|
241
|
-
})
|
|
242
|
-
|
|
243
|
-
getHostElement().then(() => {
|
|
244
|
-
model.value = 'Option 2'
|
|
245
|
-
})
|
|
246
|
-
getHostElement().get('.q-field__messages').should('not.contain', errorMessage)
|
|
247
|
-
|
|
248
|
-
getHostElement().get('input').then(() => {
|
|
249
|
-
Cypress.vueWrapper.vm.blur()
|
|
250
|
-
getHostElement().get('.q-field__messages').should('not.contain', errorMessage)
|
|
251
|
-
Cypress.vueWrapper.vm.validate()
|
|
252
|
-
getHostElement().get('.q-field__messages').should('contain', errorMessage)
|
|
253
|
-
})
|
|
254
|
-
})
|
|
255
|
-
})
|
|
256
|
-
})
|
|
257
|
-
})
|