From c63e70054d13072b54c0eecc9afd7308d92fddb1 Mon Sep 17 00:00:00 2001 From: Jake Lauritsen Date: Mon, 22 Jul 2024 10:47:28 -0700 Subject: [PATCH] Register a mock media list if one exists on the static def of layout --- test/unit/layout.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/unit/layout.js b/test/unit/layout.js index 688314f45..f6c2ee912 100644 --- a/test/unit/layout.js +++ b/test/unit/layout.js @@ -22,6 +22,10 @@ describe('MaterialLayout', function () { } MockMediaQueryList.registry = {}; + if(window.MaterialLayout.prototype.screenSizeMediaQuery_){ + var query = window.MaterialLayout.prototype.Constant_.MAX_WIDTH + MockMediaQueryList.registry[query] = new MockMediaQueryList(query) + } MockMediaQueryList.mockMatchMedia = function(query) { if (! MockMediaQueryList.registry.hasOwnProperty(query)) {