Fix wrong room topic tooltip position (#10667)
* Fix wrong room topic tooltip position * Update snapshots * Fix tests
This commit is contained in:
parent
93b4ee654b
commit
1efa82917a
5 changed files with 101 additions and 97 deletions
|
@ -52,24 +52,27 @@ describe("PosthogAnalytics", () => {
|
|||
beforeEach(() => {
|
||||
fakePosthog = getFakePosthog();
|
||||
|
||||
window.crypto = {
|
||||
subtle: {
|
||||
digest: async (_: AlgorithmIdentifier, encodedMessage: BufferSource) => {
|
||||
const message = new TextDecoder().decode(encodedMessage);
|
||||
const hexHash = shaHashes[message];
|
||||
const bytes: number[] = [];
|
||||
for (let c = 0; c < hexHash.length; c += 2) {
|
||||
bytes.push(parseInt(hexHash.slice(c, c + 2), 16));
|
||||
}
|
||||
return bytes as unknown as ArrayBuffer;
|
||||
Object.defineProperty(window, "crypto", {
|
||||
value: {
|
||||
subtle: {
|
||||
digest: async (_: AlgorithmIdentifier, encodedMessage: BufferSource) => {
|
||||
const message = new TextDecoder().decode(encodedMessage);
|
||||
const hexHash = shaHashes[message];
|
||||
const bytes: number[] = [];
|
||||
for (let c = 0; c < hexHash.length; c += 2) {
|
||||
bytes.push(parseInt(hexHash.slice(c, c + 2), 16));
|
||||
}
|
||||
return bytes;
|
||||
},
|
||||
},
|
||||
} as unknown as SubtleCrypto,
|
||||
} as unknown as Crypto;
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// @ts-ignore
|
||||
window.crypto = null;
|
||||
Object.defineProperty(window, "crypto", {
|
||||
value: null,
|
||||
});
|
||||
SdkConfig.unset(); // we touch the config, so clean up
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue