From eb1d1517ca3ac889b0ef428c30a6b8ee2d0fec01 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 29 Mar 2019 18:01:04 +0000 Subject: [PATCH] Setup crypto store for restore session tests The new storage consistency work expects a crypto store exist together with local storage. This updates the loading tests to create them together. Needed for https://github.com/vector-im/riot-web/issues/9109 --- test/app-tests/loading.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/app-tests/loading.js b/test/app-tests/loading.js index 6d9f272758b..b2df82e6e4e 100644 --- a/test/app-tests/loading.js +++ b/test/app-tests/loading.js @@ -293,12 +293,19 @@ describe('loading:', function() { }); describe("MatrixClient rehydrated from stored credentials:", function() { - beforeEach(function() { + beforeEach(async function() { localStorage.setItem("mx_hs_url", "http://localhost" ); localStorage.setItem("mx_is_url", "http://localhost" ); localStorage.setItem("mx_access_token", "access_token"); localStorage.setItem("mx_user_id", "@me:localhost"); localStorage.setItem("mx_last_room_id", "!last_room:id"); + + // Create a crypto store as well to satisfy storage consistency checks + const cryptoStore = new jssdk.IndexedDBCryptoStore( + indexedDB, + "matrix-js-sdk:crypto", + ); + await cryptoStore._connect(); }); it('shows the last known room by default', function() {