Initialize plotconfig, cypress-assert for existance

This commit is contained in:
Matthias 2023-10-10 06:48:27 +02:00
parent 20446056be
commit 2c6de162c9
2 changed files with 8 additions and 0 deletions

View File

@ -41,5 +41,7 @@ describe('Chart', () => {
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');
});
});

View File

@ -81,5 +81,11 @@ export const usePlotConfigStore = defineStore('plotConfig', {
persist: {
key: FT_PLOT_CONFIG_KEY,
paths: ['plotConfigName', 'customPlotConfigs'],
afterRestore: (context) => {
if (Object.keys(context.store.customPlotConfigs).length === 0) {
console.log('Initialized plotconfig');
context.store.customPlotConfigs = { default: deepClone(EMPTY_PLOTCONFIG) };
}
},
},
});