diff --git a/packages/ncform-e2e/ncform/cypress/integration/examples/extend.spec.js b/packages/ncform-e2e/ncform/cypress/integration/examples/extend.spec.js new file mode 100644 index 0000000..73df8fe --- /dev/null +++ b/packages/ncform-e2e/ncform/cypress/integration/examples/extend.spec.js @@ -0,0 +1,38 @@ +/// + +const md5 = require('blueimp-md5'); + +context('Extend', () => { + + before(() => { + cy.visit('http://localhost:3000/examples/components/vue-ncform/_extend.html') + }) + + it('Control: extend', () => { + let id = md5('Control: extend'); + cy.get(`[data-cy=${id}]`).within(() => { + cy.get('.__ncform-control').contains('hello world: ncform ncform').should('exist'); + cy.get('.__ncform-control').contains('Hi daniel: ncform ncform').should('exist'); + }) + }) + + it('Rule: extend', () => { + let id = md5('Rule: extend'); + cy.get(`[data-cy=${id}]`).within(() => { + cy.get('label').contains('helloWorld').next().find('input').as('worldInput'); + cy.get('label').contains('helloDaniel').next().find('input').as('danielInput'); + + cy.get('@worldInput').type('daniel'); + cy.get('@worldInput').next('.invalid-feedback').should('be.visible'); + cy.get('@worldInput').clear().type('world'); + cy.get('@worldInput').next('.invalid-feedback').should('not.be.visible'); + + cy.get('@danielInput').type('world'); + cy.get('@danielInput').next('.invalid-feedback').should('be.visible'); + cy.get('@danielInput').clear().type('daniel'); + cy.get('@danielInput').next('.invalid-feedback').should('not.be.visible'); + + }) + }) + +}) diff --git a/packages/ncform/examples/components/vue-ncform/_extend.html b/packages/ncform/examples/components/vue-ncform/_extend.html new file mode 100644 index 0000000..6a88c89 --- /dev/null +++ b/packages/ncform/examples/components/vue-ncform/_extend.html @@ -0,0 +1,177 @@ + + + + + vue-ncform Example + + + + + +
+ +
+ + + + + + + + diff --git a/packages/ncform/examples/components/vue-ncform/ext-components-use.html b/packages/ncform/examples/components/vue-ncform/ext-components-use.html deleted file mode 100755 index ad46c44..0000000 --- a/packages/ncform/examples/components/vue-ncform/ext-components-use.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - vue-ncform Example - - - - - - - - -
- - - -
- - - - - - - - - diff --git a/packages/ncform/examples/components/vue-ncform/ext-rule-use.html b/packages/ncform/examples/components/vue-ncform/ext-rule-use.html deleted file mode 100755 index d5a59fb..0000000 --- a/packages/ncform/examples/components/vue-ncform/ext-rule-use.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - vue-ncform Example - - - - - - - - -
- - - -
- - - - - - - - -