Skip to content

Commit

Permalink
Register a mock media list if one exists on the static def of layout
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelauritsen committed Jul 22, 2024
1 parent 8ce3abd commit c63e700
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/unit/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit c63e700

Please sign in to comment.