From fca626fc5e8b5242fe644414b14e94545f37dc07 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Thu, 9 Dec 2021 16:08:03 +0100 Subject: [PATCH] fix(client): prevent load from local storage (#44440) --- .../Challenges/redux/code-storage-epic.js | 4 ++- .../learn/challenges/code-storage.js | 27 ++++++++++--------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/client/src/templates/Challenges/redux/code-storage-epic.js b/client/src/templates/Challenges/redux/code-storage-epic.js index 3cda3bf43f..46c2023afb 100644 --- a/client/src/templates/Challenges/redux/code-storage-epic.js +++ b/client/src/templates/Challenges/redux/code-storage-epic.js @@ -121,6 +121,8 @@ function saveCodeEpic(action$, state$) { ); } +// TODO: Ignored temporarily while we update the code storage UI +// eslint-disable-next-line no-unused-vars function loadCodeEpic(action$, state$) { return action$.pipe( ofType(actionTypes.challengeMounted), @@ -173,4 +175,4 @@ function loadCodeEpic(action$, state$) { ); } -export default combineEpics(saveCodeEpic, loadCodeEpic, clearCodeEpic); +export default combineEpics(saveCodeEpic, clearCodeEpic); diff --git a/cypress/integration/learn/challenges/code-storage.js b/cypress/integration/learn/challenges/code-storage.js index cdf490f62b..2c1b389444 100644 --- a/cypress/integration/learn/challenges/code-storage.js +++ b/cypress/integration/learn/challenges/code-storage.js @@ -19,17 +19,18 @@ describe('Challenge with editor', function () { cy.get('@editor', { timeout: 10000 }).contains(editorContents); }); - it('renders code from localStorage after "Ctrl + S"', () => { - const editorContents = `

Hello

`; - cy.get(selectors.editor).as('editor').contains(editorContents); - cy.get('@editor') - .click() - .focused() - .type(`{movetoend}

Hello World

{ctrl+s}`); - cy.contains("Saved! Your code was saved to your browser's local storage."); - cy.reload(); - cy.get('@editor', { timeout: 10000 }).contains( - '

Hello

Hello World

' - ); - }); + // DISABLED until we update the local storage UI + // it('renders code from localStorage after "Ctrl + S"', () => { + // const editorContents = `

Hello

`; + // cy.get(selectors.editor).as('editor').contains(editorContents); + // cy.get('@editor') + // .click() + // .focused() + // .type(`{movetoend}

Hello World

{ctrl+s}`); + // cy.contains("Saved! Your code was saved to your browser's local storage."); + // cy.reload(); + // cy.get('@editor', { timeout: 10000 }).contains( + // '

Hello

Hello World

' + // ); + // }); });