Fix types

This commit is contained in:
Robin Townsend 2023-05-13 14:27:01 -04:00
parent fcb923f6db
commit 7d454645d0

View file

@ -1,3 +1,8 @@
import { GroupCallStatsReport } from "matrix-js-sdk/src/webrtc/groupCall";
import {
AudioConcealment,
ConnectionStatsReport,
} from "matrix-js-sdk/src/webrtc/stats/statsReport";
import { ObjectFlattener } from "../../src/otel/ObjectFlattener"; import { ObjectFlattener } from "../../src/otel/ObjectFlattener";
/* /*
@ -16,7 +21,12 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
describe("ObjectFlattener", () => { describe("ObjectFlattener", () => {
const statsReport = { const noConcealment: AudioConcealment = {
concealedAudio: 0,
totalAudioDuration: 0,
};
const statsReport: GroupCallStatsReport<ConnectionStatsReport> = {
report: { report: {
bandwidth: { upload: 426, download: 0 }, bandwidth: { upload: 426, download: 0 },
bitrate: { bitrate: {
@ -92,8 +102,14 @@ describe("ObjectFlattener", () => {
rtt: null, rtt: null,
}, },
], ],
audioConcealment: new Map([
["REMOTE_AUDIO_TRACK_ID", noConcealment],
["REMOTE_VIDEO_TRACK_ID", noConcealment],
]),
totalAudioConcealment: noConcealment,
}, },
}; };
describe("on flattenObjectRecursive", () => { describe("on flattenObjectRecursive", () => {
it("should flatter an Map object", () => { it("should flatter an Map object", () => {
const flatObject = {}; const flatObject = {};