Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(QDialog): add QDialog tests #16636

Merged
merged 10 commits into from
Feb 23, 2024
4 changes: 2 additions & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@
"devDependencies": {
"@quasar/app-vite": "^2.0.0-beta.1",
"@quasar/extras": "^1.16.4",
"@quasar/quasar-app-extension-testing-e2e-cypress": "^5.2.0",
"@quasar/quasar-app-extension-testing-e2e-cypress": "^5.2.1",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-replace": "^2.3.3",
"autoprefixer": "^10.4.17",
"babel-preset-es2015-rollup": "^3.0.0",
"cli-highlight": "^2.1.11",
"cross-env": "^7.0.3",
"cssnano": "^5.1.14",
"cypress": "^13.6.4",
"cypress": "^13.6.6",
"cypress-json-results": "^1.2.1",
"diff": "^5.2.0",
"eslint": "^8.56.0",
Expand Down
33 changes: 33 additions & 0 deletions ui/src/components/dialog/__tests__/DialogWrapper.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<template>
<q-dialog ref="dialogRef" v-bind="$attrs">
<q-card>
<q-card-section>
<q-btn label="Dialog Button" data-cy="dialog-button"/>
</q-card-section>
</q-card>
</q-dialog>

<q-input data-cy="input-field"/>
</template>

<script>
import { defineComponent, ref } from 'vue'

export default defineComponent({
inheritAttrs: false,
setup () {
const dialogRef = ref(null)

function focus () {
dialogRef.value.focus()
}

function shake () {
dialogRef.value.shake()
}

return { dialogRef, focus, shake }
}
})

</script>
Loading
Loading