Skip to content

Commit

Permalink
Setup crypto store for restore session tests
Browse files Browse the repository at this point in the history
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 element-hq#9109
  • Loading branch information
jryans committed Mar 29, 2019
1 parent fa10022 commit eb1d151
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/app-tests/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit eb1d151

Please sign in to comment.