30 test failures to go :D

This commit is contained in:
Michael Telatynski 2019-12-16 11:12:48 +00:00
parent ffa2ac172c
commit 6ad31fe023
33 changed files with 424 additions and 709 deletions

View file

@ -16,9 +16,7 @@ limitations under the License.
"use strict";
import * as MegolmExportEncryption from '../../src/utils/MegolmExportEncryption';
import expect from 'expect';
import SubtleCrypto from 'subtle';
const TEST_VECTORS=[
[
@ -58,19 +56,22 @@ const TEST_VECTORS=[
"bWnSXS9oymiqwUIGs08sXI33ZA==\n" +
"-----END MEGOLM SESSION DATA-----",
],
]
;
];
function stringToArray(s) {
return new TextEncoder().encode(s).buffer;
}
describe('MegolmExportEncryption', function() {
before(function() {
// if we don't have subtlecrypto, go home now
if (!window.crypto.subtle && !window.crypto.webkitSubtle) {
this.skip();
}
let MegolmExportEncryption;
beforeAll(() => {
window.crypto = { subtle: SubtleCrypto };
MegolmExportEncryption = require("../../src/utils/MegolmExportEncryption");
});
afterAll(() => {
window.crypto = undefined;
});
describe('decrypt', function() {

View file

@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import expect from 'expect';
import peg from '../../../src/MatrixClientPeg';
import {
makeGroupPermalink,
@ -66,17 +65,11 @@ function mockRoom(roomId, members, serverACL) {
}
describe('Permalinks', function() {
let sandbox;
beforeEach(function() {
sandbox = testUtils.stubClient();
testUtils.stubClient();
peg.get().credentials = { userId: "@test:example.com" };
});
afterEach(function() {
sandbox.restore();
});
it('should pick no candidate servers when the room has no members', function() {
const room = mockRoom("!fake:example.org", []);
const creator = new RoomPermalinkCreator(room);