Browse Source

chore(cypress): WIP - add test for nested form

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3655/head
Pranav C 2 years ago
parent
commit
7eb790384a
  1. 2
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  2. 23
      scripts/cypress/integration/common/4g_table_view_expanded_form.js

2
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -131,7 +131,7 @@ export default {
<Header :view="view" @cancel="onClose" />
<div class="!bg-gray-100 rounded flex-1">
<div class="flex h-full nc-form-wrapper items-stretch min-h-[max(70vh,100%)]">
<div class="flex-1 overflow-auto scrollbar-thin-dull">
<div class="flex-1 overflow-auto scrollbar-thin-dull nc-form-fields-container">
<div class="w-[500px] mx-auto">
<div
v-for="col of fields"

23
scripts/cypress/integration/common/4g_table_view_expanded_form.js

@ -66,7 +66,7 @@ export const genTest = (apiType, dbType) => {
// spy on clipboard to verify copied text
cy.window().then((win) => {
cy.spy(win.navigator.clipboard, 'writeText').as('copy');
})
});
// copy url
cy.get('.nc-copy-row-url').click();
@ -81,7 +81,8 @@ export const genTest = (apiType, dbType) => {
cy.url()
.then((url) => {
cy.visit('/' + url.split('/').slice(3).join('/').split('?')[0] + '?rowId=2');
cy.get('.nc-expanded-form-header').should('exist');
return cy.get('.nc-expanded-form-header').should('exist');
});
});
@ -91,11 +92,27 @@ export const genTest = (apiType, dbType) => {
cy.visit('/' + url.split('/').slice(3).join('/').split('?')[0] + '?rowId=99999999');
cy.toastWait('Record not found');
cy.get('.nc-expanded-form-header').should('not.exist');
cy.get(viewType === 'grid' ? '.nc-grid' : '.nc-gallery').should('exist');
return cy.get(viewType === 'grid' ? '.nc-grid' : '.nc-gallery').should('exist');
});
});
it(`Visit a ${viewType} row url and verify nested expanded form`, () => {
cy.url()
.then((url) => {
cy.visit('/' + url.split('/').slice(3).join('/').split('?')[0] + '?rowId=2');
cy.get('.nc-expanded-form-header').should('exist');
cy.get('.nc-form-fields-container').scrollTo(0, 800);
// todo: click on a LTAR field to open nested expanded form
// and verify copy url functionality
// cy.get('.name:contains("City List")').
// return cy.wait(100000)
});
});
};
viewTest('grid'); // grid view

Loading…
Cancel
Save