11import adjustContainer from "./adjustContainer" ;
22import containerRegistry from "./containerRegistry" ;
33import { SELECTOR , QUERIES } from "@zeecoder/container-query-meta-builder" ;
4+ import getContainerSize from "./getContainerSize" ;
5+ import getChangedStyles from "./getChangedStyles" ;
46
57jest . mock ( "./getChangedStyles" ) ;
68jest . mock ( "./getContainerSize" ) ;
79
810beforeEach ( ( ) => {
9- require ( "./ getChangedStyles" ) . default . mockClear ( ) ;
10- require ( "./ getContainerSize" ) . default . mockClear ( ) ;
11+ getChangedStyles . mockClear ( ) ;
12+ getContainerSize . mockClear ( ) ;
1113} ) ;
1214
1315test ( "should ignore call if the element is not registered" , ( ) => {
14- const getContainerSize = require ( "./getContainerSize" ) . default ;
1516 const containerElement = document . createElement ( "div" ) ;
1617 adjustContainer ( containerElement ) ;
1718 expect ( getContainerSize ) . toHaveBeenCalledTimes ( 0 ) ;
1819} ) ;
1920
2021test ( "should be able to get the container size itself, and ignore empty change sets" , ( ) => {
21- const getChangedStyles = require ( "./getChangedStyles" ) . default ;
22- const getContainerSize = require ( "./getContainerSize" ) . default ;
2322 const containerElement = document . createElement ( "div" ) ;
2423 const containerSize = { width : 1 , height : 2 } ;
2524 getContainerSize . mockImplementationOnce ( ( ) => containerSize ) ;
@@ -46,8 +45,6 @@ test("should be able to get the container size itself, and ignore empty change s
4645} ) ;
4746
4847test ( "should apply changed styles" , ( ) => {
49- const getChangedStyles = require ( "./getChangedStyles" ) . default ;
50- const getContainerSize = require ( "./getContainerSize" ) . default ;
5148 const containerElement = document . createElement ( "div" ) ;
5249 const containerChildElement1 = document . createElement ( "div" ) ;
5350 const containerChildElement2 = document . createElement ( "div" ) ;
@@ -101,8 +98,6 @@ test("should apply changed styles", () => {
10198} ) ;
10299
103100test ( "should respect container boundaries while applying styles" , ( ) => {
104- const getChangedStyles = require ( "./getChangedStyles" ) . default ;
105- const getContainerSize = require ( "./getContainerSize" ) . default ;
106101 const container1 = document . createElement ( "div" ) ;
107102 const container2 = document . createElement ( "div" ) ;
108103 const container1Descendant1 = document . createElement ( "div" ) ;
0 commit comments