Skip to content

Commit eb1d151

Browse files
committed
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 element-hq#9109
1 parent fa10022 commit eb1d151

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/app-tests/loading.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,19 @@ describe('loading:', function() {
293293
});
294294

295295
describe("MatrixClient rehydrated from stored credentials:", function() {
296-
beforeEach(function() {
296+
beforeEach(async function() {
297297
localStorage.setItem("mx_hs_url", "http://localhost" );
298298
localStorage.setItem("mx_is_url", "http://localhost" );
299299
localStorage.setItem("mx_access_token", "access_token");
300300
localStorage.setItem("mx_user_id", "@me:localhost");
301301
localStorage.setItem("mx_last_room_id", "!last_room:id");
302+
303+
// Create a crypto store as well to satisfy storage consistency checks
304+
const cryptoStore = new jssdk.IndexedDBCryptoStore(
305+
indexedDB,
306+
"matrix-js-sdk:crypto",
307+
);
308+
await cryptoStore._connect();
302309
});
303310

304311
it('shows the last known room by default', function() {

0 commit comments

Comments
 (0)