diff --git a/cmd/install.go b/cmd/install.go index 3056d837..42883a32 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -74,6 +74,7 @@ func install(lastVer string, db *sqlx.DB, fs stuffbin.FileSystem, prompt, idempo models.ListTypePrivate, models.ListOptinSingle, pq.StringArray{"test"}, + "", ); err != nil { lo.Fatalf("error creating list: %v", err) } @@ -83,6 +84,7 @@ func install(lastVer string, db *sqlx.DB, fs stuffbin.FileSystem, prompt, idempo models.ListTypePublic, models.ListOptinDouble, pq.StringArray{"test"}, + "", ); err != nil { lo.Fatalf("error creating list: %v", err) } diff --git a/frontend/cypress/e2e/lists.cy.js b/frontend/cypress/e2e/lists.cy.js index 7a5b3c57..5e47b672 100644 --- a/frontend/cypress/e2e/lists.cy.js +++ b/frontend/cypress/e2e/lists.cy.js @@ -51,6 +51,7 @@ describe('Lists', () => { cy.get('select[name=type]').select('public'); cy.get('select[name=optin]').select('double'); cy.get('input[name=tags]').clear().type(`tag${n}{enter}`); + cy.get('textarea[name=description]').clear().type(`desc${n}`); cy.get('[data-cy=btn-save]').click(); cy.wait(100); }); @@ -94,6 +95,7 @@ describe('Lists', () => { cy.get('select[name=type]').select(t); cy.get('select[name=optin]').select(o); cy.get('input[name=tags]').type(`tag${n}{enter}${t}{enter}${o}{enter}`); + cy.get('textarea[name=description]').clear().type(`desc-${t}-${n}`); cy.get('[data-cy=btn-save]').click(); cy.wait(200); @@ -133,4 +135,22 @@ describe('Lists', () => { cy.sortTable('thead th.cy-updated_at', [3, 4, 5, 6]); cy.sortTable('thead th.cy-updated_at', [6, 5, 4, 3]); }); + + it('Opens forms page', () => { + const apiUrl = Cypress.env('apiUrl'); + cy.loginAndVisit(`${apiUrl}/subscription/form`); + cy.get('ul li').its('length').should('eq', 2); + + const cases = [ + { 'name': 'list-public-single-2', 'description': 'desc-public-2' }, + { 'name': 'list-public-double-3', 'description': 'desc-public-3' } + ]; + + cases.forEach((c, n) => { + cy.get('ul li').eq(n).then(($el) => { + cy.wrap($el).get('label').contains(c.name); + cy.wrap($el).get('.description').contains(c.description); + }); + }); + }); }); diff --git a/frontend/src/views/Forms.vue b/frontend/src/views/Forms.vue index b032a651..c9452fea 100644 --- a/frontend/src/views/Forms.vue +++ b/frontend/src/views/Forms.vue @@ -47,7 +47,7 @@ <p><input type="submit" value="{{ $t('public.sub') }}" /></p> diff --git a/frontend/src/views/ListForm.vue b/frontend/src/views/ListForm.vue index 0a0a912d..e233b83d 100644 --- a/frontend/src/views/ListForm.vue +++ b/frontend/src/views/ListForm.vue @@ -38,6 +38,11 @@ + + + +