New Angular UI from 1806
[vid.git] / vid-webpack-master / cypress / support / application / application.session.actions.ts
1 declare namespace Cypress {
2   interface Chainable {
3     setReduxState : typeof setReduxState;
4   }
5 }
6
7 /**********************************
8  Type to input with id some text
9  *********************************/
10 function setReduxState(state?: string) : void {
11   cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
12     cy.window().then((win) => {
13       win.sessionStorage.setItem('reduxState',  JSON.stringify(state ? state : res));
14     });
15   });
16 }
17
18
19
20 Cypress.Commands.add('setReduxState', setReduxState);
21