import { Hash , PrintableArea } from "../../src" ; import { makeRandomPrintableArea } from "./testUtils" ; describe ( "Hash.printableArea uniquely identifies a printable area" , ( ) => { it ( "case: different printable areas, different hashes" , ( ) => { const printableArea0 = makeRandomPrintableArea ( ) ; const printableArea1 = makeRandomPrintableArea ( ) ; expect ( Hash . printableArea ( printableArea0 ) ) . not . toEqual ( Hash . printableArea ( printableArea1 ) ) ; } ) ; it ( "case: different width, different hashes" , ( ) => { const printableArea0 = makeRandomPrintableArea ( ) ; const printableArea1 = { ... printableArea0 , width : makeRandomPrintableArea ( ) . width , } ; expect ( Hash . printableArea ( printableArea0 ) ) . not . toEqual ( Hash . printableArea ( printableArea1 ) ) ; } ) ; it ( "case: different height, different hashes" , ( ) => { const printableArea0 = makeRandomPrintableArea ( ) ; const printableArea1 = { ... printableArea0 , height : makeRandomPrintableArea ( ) . height , } ; expect ( Hash . printableArea ( printableArea0 ) ) . not . toEqual ( Hash . printableArea ( printableArea1 ) ) ; } ) ; it ( "case: same width and height, same hashes" , ( ) => { const printableArea0 = makeRandomPrintableArea ( ) ; const printableArea1 = { ... printableArea0 } ; expect ( Hash . printableArea ( printableArea0 ) ) . toEqual ( Hash . printableArea ( printableArea1 ) ) ; } ) ; } ) ;