diff --git a/Dockerfile b/Dockerfile index b29baf8db..d73a4fe80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Stage 1: Build application -FROM node:16.3.0 AS compile-image +FROM node:16 AS compile-image WORKDIR /build diff --git a/cypress/integration/list/list.spec.js b/cypress/integration/list/list.spec.js index 843d82913..57e98b15d 100644 --- a/cypress/integration/list/list.spec.js +++ b/cypress/integration/list/list.spec.js @@ -511,4 +511,34 @@ describe('Lists', () => { .should('not.contain', task.title) }) }) + + describe('List history', () => { + it('should show a list history on the home page', () => { + const lists = ListFactory.create(6) + + cy.visit('/') + cy.get('h3') + .contains('Last viewed') + .should('not.exist') + + cy.visit(`/lists/${lists[0].id}`) + cy.visit(`/lists/${lists[1].id}`) + cy.visit(`/lists/${lists[2].id}`) + cy.visit(`/lists/${lists[3].id}`) + cy.visit(`/lists/${lists[4].id}`) + cy.visit(`/lists/${lists[5].id}`) + + cy.visit('/') + cy.get('h3') + .contains('Last viewed') + .should('exist') + cy.get('.list-cards-wrapper-2-rows') + .should('not.contain', lists[0].title) + .should('contain', lists[1].title) + .should('contain', lists[2].title) + .should('contain', lists[3].title) + .should('contain', lists[4].title) + .should('contain', lists[5].title) + }) + }) }) diff --git a/cypress/integration/misc/home.spec.js b/cypress/integration/misc/home.spec.js new file mode 100644 index 000000000..82cbeed22 --- /dev/null +++ b/cypress/integration/misc/home.spec.js @@ -0,0 +1,35 @@ +import '../../support/authenticateUser' + +const setHours = hours => { + const date = new Date() + date.setHours(hours) + cy.clock(+date) +} + +describe('Home Page', () => { + it('shows the right salutation in the night', () => { + setHours(4) + cy.visit('/') + cy.get('h2').should('contain', 'Good Night') + }) + it('shows the right salutation in the morning', () => { + setHours(8) + cy.visit('/') + cy.get('h2').should('contain', 'Good Morning') + }) + it('shows the right salutation in the day', () => { + setHours(13) + cy.visit('/') + cy.get('h2').should('contain', 'Hi') + }) + it('shows the right salutation in the night', () => { + setHours(20) + cy.visit('/') + cy.get('h2').should('contain', 'Good Evening') + }) + it('shows the right salutation in the night again', () => { + setHours(23) + cy.visit('/') + cy.get('h2').should('contain', 'Good Night') + }) +}) \ No newline at end of file diff --git a/cypress/integration/user/login.spec.js b/cypress/integration/user/login.spec.js index d1cde64ef..ce6086ce0 100644 --- a/cypress/integration/user/login.spec.js +++ b/cypress/integration/user/login.spec.js @@ -34,6 +34,7 @@ context('Login', () => { cy.get('input[id=password]').type(fixture.password) cy.get('.button').contains('Login').click() cy.url().should('include', '/') + cy.clock(1625656161057) // 13:00 cy.get('h2').should('contain', `Hi ${fixture.username}!`) }) diff --git a/cypress/integration/user/registration.spec.js b/cypress/integration/user/registration.spec.js index 37c238e34..3e7cf1f54 100644 --- a/cypress/integration/user/registration.spec.js +++ b/cypress/integration/user/registration.spec.js @@ -28,6 +28,7 @@ context('Registration', () => { cy.get('#password2').type(fixture.password) cy.get('#register-submit').click() cy.url().should('include', '/') + cy.clock(1625656161057) // 13:00 cy.get('h2').should('contain', `Hi ${fixture.username}!`) }) diff --git a/package.json b/package.json index 50f45dac6..38208a235 100644 --- a/package.json +++ b/package.json @@ -18,12 +18,12 @@ "camel-case": "4.1.2", "copy-to-clipboard": "3.3.1", "date-fns": "2.22.1", - "dompurify": "2.2.9", + "dompurify": "2.3.0", "highlight.js": "11.0.1", "lodash": "4.17.21", "marked": "2.1.3", "register-service-worker": "1.7.2", - "sass": "1.35.1", + "sass": "1.35.2", "snake-case": "3.0.4", "verte": "0.0.12", "vue": "2.6.14", @@ -47,14 +47,14 @@ "@vue/cli-service": "4.5.13", "axios": "0.21.1", "babel-eslint": "10.1.0", - "cypress": "7.6.0", + "cypress": "7.7.0", "cypress-file-upload": "5.0.8", - "eslint": "7.29.0", - "eslint-plugin-vue": "7.12.1", + "eslint": "7.30.0", + "eslint-plugin-vue": "7.13.0", "faker": "5.5.3", - "jest": "27.0.5", + "jest": "27.0.6", "sass-loader": "10.2.0", - "vue-flatpickr-component": "8.1.6", + "vue-flatpickr-component": "8.1.7", "vue-notification": "1.3.20", "vue-router": "3.5.2", "vue-template-compiler": "2.6.14", @@ -92,6 +92,7 @@ "jest": { "testPathIgnorePatterns": [ "cypress" - ] + ], + "testEnvironment": "jsdom" } } diff --git a/src/components/home/navigation.vue b/src/components/home/navigation.vue index 65b045088..ed91c1771 100644 --- a/src/components/home/navigation.vue +++ b/src/components/home/navigation.vue @@ -54,14 +54,14 @@ + v-tooltip="getNamespaceTitle(n) + ' (' + n.lists.filter(l => !l.isArchived).length + ')'"> - {{ n.title }} ({{ n.lists.filter(l => !l.isArchived).length }}) + {{ getNamespaceTitle(n) }} ({{ n.lists.filter(l => !l.isArchived).length }}) - {{ l.title }} + {{ getListTitle(l) }} - {{ currentList.title === '' ? $t('misc.loading') : currentList.title }} + {{ currentList.title === '' ? $t('misc.loading') : getListTitle(currentList) }} @@ -82,6 +82,9 @@ {{ $t('keyboardShortcuts.title') }} + + {{ $t('about.title') }} + {{ $t('user.auth.logout') }} diff --git a/src/components/input/editor.vue b/src/components/input/editor.vue index 068799901..4b9ced964 100644 --- a/src/components/input/editor.vue +++ b/src/components/input/editor.vue @@ -35,15 +35,15 @@

{{ emptyText }}