Skip to content
Snippets Groups Projects
Commit f9ec6256 authored by Kirill Stytsenko's avatar Kirill Stytsenko
Browse files

WiP on db e2e test

Former-commit-id: 9a53ec09
parent 005bb472
No related branches found
No related tags found
1 merge request!23Sprint results
......@@ -6,6 +6,7 @@
<v-card-text>
<v-form v-model="formValid">
<v-text-field
id="dbname"
v-model="database"
label="Name"
:rules="[v => !!v || $t('Required')]"
......
......@@ -112,7 +112,21 @@ export default {
return this.$store.state.db
}
},
async mounted () {
watch: {
$route () {
this.loadDB()
}
},
mounted () {
this.loadDB()
},
methods: {
async loadDB () {
// this route already loads the db itself
if (this.$route.name.startsWith('db-db_id___')) {
return
}
if (this.$route.params.db_id && !this.db) {
try {
const res = await this.$axios.get(`/api/database/${this.$route.params.db_id}`)
......@@ -123,4 +137,5 @@ export default {
}
}
}
}
</script>
......@@ -13,6 +13,7 @@
"lint": "yarn lint:js",
"test:unit": "ava test/unit/**/* test/specs/**/*",
"test:watch": "ava --watch test/unit/**/* test/specs/**/*",
"test:watch:e2e": "cross-env PORT=3001 ava --watch test/e2e/**/*",
"test:e2e:dev": "cross-env PORT=3001 ava test/e2e/**",
"test:e2e:prod": "cross-env PORT=3000 ava test/e2e/**",
"test": "yarn test:unit && yarn test:e2e:prod"
......
......@@ -29,6 +29,14 @@ export default {
db () {
return this.$store.state.db
}
},
async mounted () {
try {
const res = await this.$axios.get(`/api/database/${this.$route.params.db_id}`)
this.$store.commit('SET_DATABASE', res.data)
} catch (err) {
this.$toast.error('Could not load database.')
}
}
}
</script>
const test = require('ava')
const { pageMacro, before, after } = require('./_utils')
test.before(before)
test.after(after)
test('create & delete database', pageMacro, async (t, page) => {
await page.go('/databases')
// t.is(await page.title(), 'fda-ui - fda-ui')
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment