Browse Source

test(cypress): provide delay to sync view metas

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/765/head
Pranav C 3 years ago
parent
commit
be131d7dfe
  1. 9
      package-lock.json
  2. 3
      package.json
  3. 10
      packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue
  4. 13
      packages/nc-gui/components/project/spreadsheet/public/xcForm.vue
  5. 2
      scripts/cypress/integration/common/6f_attachments.js

9
package-lock.json generated

@ -3570,6 +3570,15 @@
"parse-json": "^4.0.0" "parse-json": "^4.0.0"
} }
}, },
"cross-env": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
"integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.1"
}
},
"cross-spawn": { "cross-spawn": {
"version": "7.0.3", "version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",

3
package.json

@ -2,13 +2,14 @@
"name": "root", "name": "root",
"devDependencies": { "devDependencies": {
"@4tw/cypress-drag-drop": "^2.0.0", "@4tw/cypress-drag-drop": "^2.0.0",
"cross-env": "^7.0.3",
"cypress": "^7.3.0", "cypress": "^7.3.0",
"cypress-file-upload": "^5.0.8", "cypress-file-upload": "^5.0.8",
"jsdoc-to-markdown": "^5.0.3", "jsdoc-to-markdown": "^5.0.3",
"lerna": "^3.20.1" "lerna": "^3.20.1"
}, },
"scripts": { "scripts": {
"start:api": "cd ./packages/nocodb; npm install; npm run watch:run", "start:api": "cd ./packages/nocodb; npm install; cross-env NC_DISABLE_TELE=true npm run watch:run",
"start:web": "cd ./packages/nc-gui; npm install; npm run dev", "start:web": "cd ./packages/nc-gui; npm install; npm run dev",
"cypress:run": "cypress run --config-file ./scripts/cypress/cypress.json", "cypress:run": "cypress run --config-file ./scripts/cypress/cypress.json",
"cypress:open": "cypress open --config-file ./scripts/cypress/cypress.json", "cypress:open": "cypress open --config-file ./scripts/cypress/cypress.json",

10
packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue

@ -436,7 +436,7 @@
<!-- People with private link can only see cells visible in this view --> <!-- People with private link can only see cells visible in this view -->
</p> </p>
<div style="border-radius: 4px" class="share-link-box body-2 pa-2 d-flex align-center"> <div style="border-radius: 4px" class="share-link-box body-2 pa-2 d-flex align-center">
{{ `${dashboardUrl}#/nc/${shareLink.view_type === 'form' ? 'form' : 'view' }/${shareLink.view_id}` }} {{ `${dashboardUrl}#/nc/${shareLink.view_type === 'form' ? 'form' : 'view'}/${shareLink.view_id}` }}
<v-spacer /> <v-spacer />
<a <a
:href=" `${dashboardUrl}#/nc/${shareLink.view_type === 'form' ? 'form' : 'view'}/${shareLink.view_id}`" :href=" `${dashboardUrl}#/nc/${shareLink.view_type === 'form' ? 'form' : 'view'}/${shareLink.view_id}`"
@ -590,6 +590,7 @@ export default {
if (this.load) { if (this.load) {
await this.loadViews() await this.loadViews()
} }
this.onViewIdChange(this.selectedViewIdLocal)
}, },
methods: { methods: {
onViewIdChange(id) { onViewIdChange(id) {
@ -631,7 +632,8 @@ export default {
fieldsOrder: JSON.parse(mainView.query_params).fieldsOrder fieldsOrder: JSON.parse(mainView.query_params).fieldsOrder
}) })
} }
} catch {} } catch {
}
this.createViewType = type this.createViewType = type
this.showCreateView = true this.showCreateView = true
}, },
@ -711,7 +713,9 @@ export default {
const old_title = view.title const old_title = view.title
this.$set(view, 'edit', false) this.$set(view, 'edit', false)
if (view.title_temp === view.title) { return } if (view.title_temp === view.title) {
return
}
if (this.viewsList.some((v, i) => i !== index && (v.alias || v.title) === view.title_temp)) { if (this.viewsList.some((v, i) => i !== index && (v.alias || v.title) === view.title_temp)) {
this.$toast.info('View name should be unique').goAway(3000) this.$toast.info('View name should be unique').goAway(3000)
return return

13
packages/nc-gui/components/project/spreadsheet/public/xcForm.vue

@ -398,19 +398,6 @@ export default {
formData formData
}) })
//
// data = { ...this.localState, ...data }
//
// // save hasmany and manytomany relations from local state
// if (this.$refs.virtual && Array.isArray(this.$refs.virtual)) {
// for (const vcell of this.$refs.virtual) {
// if (vcell.save) {
// await vcell.save(data)
// }
// }
// }
//
this.virtual = {} this.virtual = {}
this.localState = {} this.localState = {}

2
scripts/cypress/integration/common/6f_attachments.js

@ -40,8 +40,8 @@ export const genTest = (type, xcdb) => {
// create form-view // create form-view
cy.get(`.nc-create-form-view`).click(); cy.get(`.nc-create-form-view`).click();
cy.getActiveModal().find('button:contains(Submit)').click() cy.getActiveModal().find('button:contains(Submit)').click()
cy.get(`.nc-view-item.nc-form-view-item`).contains('Country1').click() cy.get(`.nc-view-item.nc-form-view-item`).contains('Country1').click()
cy.wait(1000)
cy.get('.v-navigation-drawer__content > .container') cy.get('.v-navigation-drawer__content > .container')
.find('.v-list > .v-list-item') .find('.v-list > .v-list-item')
.contains('Share View') .contains('Share View')

Loading…
Cancel
Save