diff --git a/Dockerfile b/Dockerfile index da977c99..ccc2e37f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.6.1-alpine as ui-builder +FROM node:20.8.1-alpine as ui-builder RUN mkdir /app diff --git a/cypress/e2e/chart.cy.ts b/cypress/e2e/chart.cy.ts new file mode 100644 index 00000000..ef1a1e80 --- /dev/null +++ b/cypress/e2e/chart.cy.ts @@ -0,0 +1,47 @@ +import { setLoginInfo, defaultMocks } from './helpers'; + +function tradeMocks() { + cy.intercept('GET', '**/api/v1/status', { fixture: 'status_empty.json' }).as('Status'); + cy.intercept('GET', '**/api/v1/profit', { fixture: 'profit.json' }).as('Profit'); + cy.intercept('GET', '**/api/v1/trades*', { fixture: 'trades.json' }).as('Trades'); + cy.intercept('GET', '**/api/v1/balance', { fixture: 'balance.json' }).as('Balance'); + cy.intercept('GET', '**/api/v1/whitelist', { fixture: 'whitelist.json' }).as('Whitelist'); + cy.intercept('GET', '**/api/v1/blacklist', { fixture: 'blacklist.json' }).as('Blacklist'); + cy.intercept('GET', '**/api/v1/locks', { fixture: 'locks_empty.json' }).as('Locks'); + cy.intercept('GET', '**/api/v1/performance', { fixture: 'performance.json' }).as('Performance'); +} + +describe('Chart', () => { + it('Chart view', { scrollBehavior: false }, () => { + defaultMocks(); + tradeMocks(); + setLoginInfo(); + cy.viewport('macbook-11'); + + cy.visit('/graph'); + cy.wait('@Ping'); + cy.wait('@Status'); + cy.wait('@Profit'); + cy.wait('@Balance'); + cy.wait('@Trades'); + cy.wait('@Whitelist'); + cy.wait('@Blacklist'); + cy.wait('@Locks'); + cy.wait('@Performance'); + cy.wait('@PairCandles'); + // Disable autorefresh + cy.get('input[title="AutoRefresh"]').click(); + + cy.get('span').contains('NoActionStrategyFut | 1m').should('be.visible'); + + cy.get('.form-check').contains('Heikin Ashi').click(); + + // Reload triggers a new request + cy.get('button[title*="Refresh chart"]').click(); + cy.wait('@PairCandles'); + // Disable Heikin Ashi + cy.get('.form-check').contains('Heikin Ashi').click(); + // Default plotconfig exists + cy.get('.form-select').get('option').contains('default').should('exist'); + }); +}); diff --git a/package.json b/package.json index 8f45b681..05c45561 100644 --- a/package.json +++ b/package.json @@ -17,18 +17,18 @@ }, "dependencies": { "@popperjs/core": "^2.11.8", - "@vuepic/vue-datepicker": "^6.1.0", - "@vueuse/core": "^10.4.1", - "@vueuse/integrations": "^10.4.1", - "axios": "^1.5.0", - "bootstrap": "^5.3.1", - "bootstrap-vue-next": "^0.12.3", - "core-js": "^3.32.2", + "@vuepic/vue-datepicker": "^7.1.0", + "@vueuse/core": "^10.5.0", + "@vueuse/integrations": "^10.5.0", + "axios": "^1.5.1", + "bootstrap": "^5.3.2", + "bootstrap-vue-next": "^0.14.8", + "core-js": "^3.33.0", "date-fns": "^2.30.0", "date-fns-tz": "^2.0.0", "echarts": "^5.4.3", "favico.js": "^0.3.10", - "humanize-duration": "^3.29.0", + "humanize-duration": "^3.30.0", "pinia": "^2.1.6", "pinia-plugin-persistedstate": "^3.2.0", "sortablejs": "^1.15.0", @@ -36,7 +36,7 @@ "vue-class-component": "^7.2.5", "vue-demi": "^0.14.6", "vue-echarts": "^6.6.1", - "vue-router": "^4.2.4", + "vue-router": "^4.2.5", "vue-select": "^4.0.0-beta.6", "vue3-drr-grid-layout": "^1.9.7" }, @@ -44,28 +44,28 @@ "@cypress/vite-dev-server": "^5.0.6", "@cypress/vue": "^6.0.0", "@iconify-json/mdi": "^1.1.54", - "@types/echarts": "^4.9.18", - "@typescript-eslint/eslint-plugin": "^6.7.0", - "@typescript-eslint/parser": "^6.7.0", - "@vitejs/plugin-vue": "^4.3.4", + "@types/echarts": "^4.9.19", + "@typescript-eslint/eslint-plugin": "^6.7.5", + "@typescript-eslint/parser": "^6.7.5", + "@vitejs/plugin-vue": "^4.4.0", "@vue/compiler-sfc": "3.3.4", "@vue/eslint-config-prettier": "^8.0.0", - "@vue/eslint-config-typescript": "^11.0.3", + "@vue/eslint-config-typescript": "^12.0.0", "@vue/runtime-dom": "^3.3.4", "@vue/test-utils": "^2.4.1", - "cypress": "^13.2.0", - "eslint": "^8.49.0", - "eslint-plugin-prettier": "^5.0.0", + "cypress": "^13.3.0", + "eslint": "^8.51.0", + "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-vue": "^9.17.0", "mutationobserver-shim": "^0.3.7", "portal-vue": "^3.0.0", "prettier": "^3.0.3", - "sass": "^1.66.1", + "sass": "^1.69.2", "typescript": "~5.2.2", "unplugin-icons": "^0.17.0", "unplugin-vue-components": "^0.25.2", - "vite": "^4.4.9", - "vitest": "^0.34.4", - "vue-tsc": "^1.8.11" + "vite": "^4.4.11", + "vitest": "^0.34.6", + "vue-tsc": "^1.8.18" } } diff --git a/src/App.vue b/src/App.vue index 822bd110..e7c43ffa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,7 @@ diff --git a/src/components/charts/PlotConfigSelect.vue b/src/components/charts/PlotConfigSelect.vue index 5b000954..b22a55f5 100644 --- a/src/components/charts/PlotConfigSelect.vue +++ b/src/components/charts/PlotConfigSelect.vue @@ -1,5 +1,5 @@