VimUnDo~JwEe]&d|"Ʋ56c(g W))))Vc"P_T>5_T`+calc = require '../src/utils/GridCalculate'5_Td5_Tchai = require 'chia'5_Tchai = require 'cha'5_Tchai = require 'ch'5_ TSdescribe 'grid calculate', ->5_   vTa$describe 'module grid calculate', ->5_  vTddescribe 'grid calculate', ->5_  vT 5_  vT  5_  vT   5_   vT & expect(calculateLayout).to.exist()5_  vT  5_ vTexpect = chai.expect5_ vTchai = require 'chai'5_ vTconsole.log expect5_ vT3 expect = chai.expect5_ vTD  console.log calc5_ vT\ expect = chai.expect()5_ vT] expect = chai.expect(5_   vTm  expect(calc).to.exist()5_   vTm   expect(calc).to.5_   vT  expect(calc).to.exist()5_   vT  expect(calc).to.exist(5_   vT  expect(calc).to.exist5_   vT 5_   vT  expect(calc).to.exist;w5_   vT   expect(calc).to.exist;5_    vT ) expect(calc).to.be.instanceof(Object)5_!   vT   5_ "!   vT  it '5_!#"   vT 5_"$#   vT   5_#%$ v T +calc = require '../src/utils/GridCalculate'5_$&% v T 'calc = require '../src/utils/Calculate'5_%'& v T +calc = require '../src/utils/SpanCalculate'5_&(' v T /spancalc = require '../src/utils/SpanCalculate'5_')(  v T + expect(calc()).to.be.instanceof(Object)5_(*) v T# 4SpanCalculate = require '../src/utils/SpanCalculate'5_)+*  v T& 4 expect(SpanCalculate()).to.be.instanceof(Object)5_*,+  V T  5_+-,  V T 5_,.-  V T " it 'should return an object', ->5_-/.vT # it 'should include an object', ->5_.0/vT  it 'should include ', ->5_/10vT5_021 vT4 expect(spanCalculate()).to.be.instanceof(Object)5_132!vT; expect(_.keys(spanCalculate()).to.be.instanceof(Object)5_243'';v;T< expect(_.keys(spanCalculate())).to.be.instanceof(Object)5_354'';v;T' expect(_.keys(spanCalculate())).to.5_465';v;T5_5762';v;T3 expect(_.keys(spanCalculate())).to.deep.equal({5_6872';v;T2 expect(_.keys(spanCalculate())).to.deep.equal(5_7:8';v;T 5_8;9: ';v;T  expect(calc).to.exist5_:<;';v;Tconsole.log calc,expect5_;=<';v;T5_<>= ';v;T $ it 'should include style keys', ->5_=?>*';v;T : it 'should return an object that include style keys', ->5_>@?';v;T 5_?A@ ';v;T- expect styles.marginLeft)5_@BA';v;T. expect(styles.marginLeft)5_ACB';v;TG 5_BDC';v;TH exp5_CED';v;TI 5_DFE';v;TR& expect(styles.marginLeft).to.exist5_EGF8';v;TY: expect(styles.marginLeft).to.equal("8.47457627118644")5_FHG-';v;Ta5_GIH';v;Tb. styles = spanCalculate({at: 1, columns:3})5_HJI';v;Th5_IKJ';v;Ti; expect(styles.marginLeft).to.equal("8.47457627118644%")5_JLK"';v;Tl6 expect(styles.width).to.equal("8.47457627118644%")5_KML';v;T console.log styles5_LNMVT5_MONVT!5_NPO  -v-T"3 it 'should set marginLeft when passing in at', ->5_OQP  -v-T" it 'should ', ->5_PRQ -v-T2 noAtstyles = spanCalculate({at: 1, columns:3})5_QSR -v-T!. styles = spanCalculate({at: 1, columns:3})5_RTS   vT!!; expect(styles.marginLeft).to.equal("8.47457627118644%")5_SUT   vT!!7 expect(styles.margin).to.equal("8.47457627118644%")5_TVU (  vT!!< expect(styles.marginRight).to.equal("8.47457627118644%")5_UWV!  vT !3 expect(styles.width).to.equal(noAtstyles.width)5_VXW  vT !  5_WYX!!vTq console.log styles5_XZY  vT{!  5_Y[Z!!vT" !5_Z\[""vT console.log "yo"5_[]\+!!vT!. styles = spanCalculate({at: 1, columns:3})5_\^]/!!vT!2 noAtstyles = spanCalculate({at: 1, columns:3})5_]_^!!vT console.log styles5_^`_   vT  - it 'should remove marginRight for last', ->5__a`   vT - it 'should remove marginRight for last', ->5_`ba*v*T 3 it 'should set marginLeft when passing in at', ->5_acb*v*T $ it 'should set marginLeft at', ->5_bdc!*v*T! & it 'should set marginLeft if at', ->5_ced%*v*T" . it 'should set marginLeft if at isn't 0', ->5_dfe %*v*TF# !   5_egf *v*TX$  console.log spanCalculate()5_fhg *v*T(%!  5_gih*v*T+&! 'break'5_hji$*v*T!3 noAtstyles = spanCalculate({at: 1, columns: 3})5_ikj$*v*T!!5_jlk *v*T"; expect(styles.marginLeft).to.equal("8.47457627118644%")5_kml+*v*T'"? expect(noAtstyles.marginLeft).to.equal("8.47457627118644%")5_lnm")")+V+T""5_mon#")+V+T"$&5_npo$ $ $&v&T#%', it 'should remove marginRight if last', ->5_oqp$ $ $&v&T#%' it 'should ', ->5_prq%$ $&v&T$&'( styles = spanCalculate({last: true})5_qsr'$ $&v&T&* expect(styles.marginRight).to.equal(0)5_rts'"$ $&v&T&$ expect(styles.clear).to.equal(0)5_sut'"$ $&v&T(&# expect(styles.clear).to.equal()5_tvu'$ $&v&T7 ', it 'should remove marginRight if last', ->5_uwv#+#V+T7#)'#$'5_vxw$ $ $vT7#%,1 it 'should remove marginRight if last prop', ->5_wyx$ $ $vT7#%, it 'should if last prop', ->5_xzy'$ $vT7&(,* expect(styles.marginRight).to.equal(0)5_y{z'"$ $vT7&(,$ expect(styles.float).to.equal(0)5_z|{'"$ $vT7)&(,# expect(styles.float).to.equal()5_{}|"$ $vT9"%- "$,5_|~}$&& &vT9$&.$%.5_}~%' 'vT9%'/%&/5_~*( (vT9)*5_&#( (vT9*%'/* expect(styles.float).to.equal("right")5_!( (vT9+ !5_$' 'vT9,#%.( styles = spanCalculate({last: true})5_.U. .5_0///V/U005_1//V/U026/ styles = spanCalculate({at: 1, columns: 3})5_2 //V/U1363 noAtstyles = spanCalculate({at: 0, columns: 3})5_2//V/U1364 noAtstyles = spanCalculate({pre: 0, columns: 3})5_2//V/U1363 notstyles = spanCalculate({pre: 0, columns: 3})5_2//V/U1362 nostyles = spanCalculate({pre: 0, columns: 3})5_6//V/U53 expect(styles.width).to.equal(noAtstyles.width)5_6//V/U665_7//V/U67 expect(styles.width).to.not.equal(noAtstyles.width)5_76//V/U-6< expect(styles.marginLeft).to.not.equal(noAtstyles.width)5_24//V/U.248 2475_6 //V/U1578- expect(noAtstyles.marginLeft).to.equal(0)5_6 //V/U1578, expect(notstyles.marginLeft).to.equal(0)5_6 //V/U1578+ expect(nostyles.marginLeft).to.equal(0)5_7(//V/U56887 expect(styles.width).to.not.equal(noAtstyles.width)5_7(//V/U56886 expect(styles.width).to.not.equal(notstyles.width)5_7(//V/U66885 expect(styles.width).to.not.equal(nostyles.width)5_8-//V/U77A expect(styles.marginLeft).to.not.equal(noAtstyles.marginLeft)5_8-//V/U77@ expect(styles.marginLeft).to.not.equal(notstyles.marginLeft)5_8-//V/U8/7? expect(styles.marginLeft).to.not.equal(nostyles.marginLeft)5_3//V/U23# console.log styles, noPrestyles5_77/VU775_97/VU8:@0 it 'should add marginLeft if pre is not 0', ->5_:7/VU9;@0 styles = spanCalculate({pre: 1, columns: 3})5_;7/VU:<@5 noPrestyles = spanCalculate({pre: 0, columns: 3})5_;7/VU:<@4 norestyles = spanCalculate({pre: 0, columns: 3})5_;7/VU:<@3 noestyles = spanCalculate({pre: 0, columns: 3})5_;7/VU:<@2 nostyles = spanCalculate({pre: 0, columns: 3})5_;$7/VU:<@8 noSquishstyles = spanCalculate({pre: 0, columns: 3})5_> 7/VU=?@. expect(noPrestyles.marginLeft).to.equal(0)5_> 7/VU=?@- expect(norestyles.marginLeft).to.equal(0)5_> 7/VU=?@, expect(noestyles.marginLeft).to.equal(0)5_> 7/VU=?@+ expect(nostyles.marginLeft).to.equal(0)5_>>>vU=?@7 expect(noSquishstylesstyles.marginLeft).to.equal(0)5_?(?(?0v0U>@@8 expect(styles.width).to.not.equal(noPrestyles.width)5_?(?(?0v0U>@@/ expect(styles.width).to.not.equal(no.width)5_@+?(?0v0U0?B expect(styles.marginLeft).to.not.equal(noPrestyles.marginLeft)5_@@8/V8UX@@5_BBBvU\ACR0 it 'should add marginLeft if pre is not 0', ->5_BBBvU]ACR- it 'should add margint if pre is not 0', ->5_BBBvU]ACR, it 'should add margin if pre is not 0', ->5_B BBvU_ACR1 it 'should add marginRight if pre is not 0', ->5_CBBvUaBDR0 styles = spanCalculate({pre: 1, columns: 3})5_D!BBvUc1CER5 noPrestyles = spanCalculate({pre: 0, columns: 3})5_FFFvUlEGR; expect(styles.marginLeft).to.equal("8.47457627118644%")5_FFFvUmEGR7 expect(styles.margin).to.equal("8.47457627118644%")5_GGG v UpFHR. expect(noPrestyles.marginLeft).to.equal(0)5_GGG v UpFHR* expect(noPrestyles.margin).to.equal(0)5_IIIvUuHJRB expect(styles.marginLeft).to.not.equal(noPrestyles.marginLeft)5_IIIvUvHJR> expect(styles.margin).to.not.equal(noPrestyles.marginLeft)5_I>IAI>v>UxHJRC expect(styles.marginRight).to.not.equal(noPrestyles.marginLeft)5_I>IAI>v>Ux2HJR? expect(styles.marginRight).to.not.equal(noPrestyles.margin)5_DDDvUCE6 noPrestyles = spanCalculate({post: 0, columns: 3})5_GDDvUFH/ expect(noPrestyles.marginRight).to.equal(0)5_HDDvUGI8 expect(styles.width).to.not.equal(noPrestyles.width)5_IDDvU3HJD expect(styles.marginRight).to.not.equal(noPrestyles.marginRight)5_KKRVU4QSE expect(styles.marginLeft).to.not.equal(noSquishstyles.marginLeft)PR; expect(styles.width).to.not.equal(noSquishstyles.width)OQ1 expect(noSquishstyles.marginLeft).to.equal(0)NP; expect(styles.marginLeft).to.equal("8.47457627118644%")MOLN; noSquishstyles = spanCalculate({squish: 0, columns: 3})KM3 styles = spanCalculate({squish: 1, columns: 3})JL3 it 'should add marginLeft if squish is not 0', ->5_DKRVU5DFS DFR5_D*LSVUCES7 noPoststyles = spanCalculate({post: 0, columns: 3})5_D5LSVU6CESB noPoststyles = spanCalculate({post: 0, last: true columns: 3})5_2LSVU T S5_.NUVU!U U5_   "v"U!V/ styles = spanCalculate({at: 1, columns: 3})5_!  "v"U!#V!"V5_"  "v"U"$W5_"""vU!#X; expect(styles.marginLeft).to.equal("8.47457627118644%")5_"""vU7!#X7 expect(styles.margin).to.equal("8.47457627118644%")5_")""vU8!#X< expect(styles.marginRight).to.equal("8.47457627118644%")5_QQXVUz9WYF #expect(styles.marginLeft).to.not.equal(noSquishstyles.marginLeft)VX< #expect(styles.width).to.not.equal(noSquishstyles.width)UW2 #expect(noSquishstyles.marginLeft).to.equal(0)TV< #expect(styles.marginLeft).to.equal("8.47457627118644%")SURT< #noSquishstyles = spanCalculate({squish: 0, columns: 3})QS4 #styles = spanCalculate({squish: 1, columns: 3})PR4 #it 'should add marginLeft if squish is not 0', ->5_SQXVUz:SUY SUX5_JQYVUz.;IJ$ console.log styles, noPoststyles5_RPXVUz6RTX5_SPYVUz7RS5_SPXVUz8<RTX console.log noSquishstyles5_SPXVUz=RS console.log styles5_HU}>HJX HJW5_H.U?GIX1 styles = spanCalculate({post: 1, columns: 3})5_IUHI console.log styles5_I@UHJWC noPoststyles = spanCalculate({post: 0, last: true, columns: 3})5_MMMvULNW9 expect(styles.width).to.not.equal(noPoststyles.width)5_KMMvUKMWKLW5_L(NNvUKMX< expect(styles.marginRight).to.equal("8.47457627118644%")5_I)I4I)v)U9HJXC noPoststyles = spanCalculate({post: 0, last: true, columns: 1})5_MI4I)v)U;@LM0 expect(noPoststyles.marginRight).to.equal(0)5_Q$I4I)v)UTPRW3 styles = spanCalculate({squish: 1, columns: 3})5_T$I4I)v)UXTVWTUW5_TI4I)v)U]ST; expect(styles.marginLeft).to.equal("8.47457627118644%")5_KI4I)v)U^JK< expect(styles.marginRight).to.equal("8.47457627118644%")5_UUUvUpTVV; expect(styles.width).to.not.equal(noSquishstyles.width)5_UUUvUpTVV8 expect(styles.width).to..equal(noSquishstyles.width)5_SUUvUsSUVSTV5_T/VVvUvASUW5 expect(styles.marginRight).to.equal(styles.width)5_6!VVvU57W0 styles = spanCalculate({pre: 1, columns: 3})5_9!VVvU9;W9:W5_9WWvU89; expect(styles.marginLeft).to.equal("8.47457627118644%")5_9VVvU8:W5 expect(styles.marginRight).to.equal(styles.width)5_;;;vU:<W8 expect(styles.width).to.not.equal(noPrestyles.width)5_=E=VUB<= 3 it 'should add marginLeft if squish is not 0', ->3 styles = spanCalculate({squish: 1, columns: 3}); noSquishstyles = spanCalculate({squish: 0, columns: 3}); expect(styles.marginLeft).to.equal("8.47457627118644%")1 expect(noSquishstyles.marginLeft).to.equal(0); expect(styles.width).to.not.equal(noSquishstyles.width)E expect(styles.marginLeft).to.not.equal(noSquishstyles.marginLeft)5_N==VUkN N5_P PP v UhO it 'should generate5_P PP v UhO it 'should 5_P2PP v UhPP5_Q$PP v UhP3 styles = spanCalculate({squish: 3, columns: 3})5_Q1PP v UhP3 styles = spanCalculate({squish: 1, columns: 3})5_Q<PP v UhCQ Q5_,PP v UkS- expect(noAtstyles.marginLeft).to.equal(0)5_&)PP v UkD%'S* expect(styles.marginRight).to.equal(0)5_&(&)&(v(Uk%'S+ expect(styles.marginRight).to.equal(0%)&'S5_++,v,UkES. expect(noAtstyles.marginLeft).to.equal(0%)S5_9+.v,UkF894 expect(styles.marginLeft).to.equal(styles.width)5_9,+.v,Uk8:R. expect(noPrestyles.marginLeft).to.equal(0)5_9.+.v,UkG8:R/ expect(noPrestyles.marginLeft).to.equal("0)5_A+.v,UlH@A5 expect(styles.marginRight).to.equal(styles.width)5_B+.v,UlBER BDQ5_D0+.v,UlDFSDES5_E+.v,UlDFT1 styles = spanCalculate({post: 1, columns: 1})5_E+.v,UlDFT4 prestyles = spanCalculate({post: 1, columns: 1})5_EEEvUlDFT4 preStyles = spanCalculate({post: 1, columns: 1})5_EEEvUlDFT1 Styles = spanCalculate({post: 1, columns: 1})5_EEEvUlEGTEFT5_FFFvUlEGU5 postStyles = spanCalculate({post: 1, columns: 1})5_FFFvUlEGU1 Styles = spanCalculate({post: 1, columns: 1})5_F"FFvUmEGU7 squishStyles = spanCalculate({post: 1, columns: 1})5_F'FFvUmIFIV FHU5_D D D=v=Um-CEWC it 'should set marginRight the same for both post and squish', ->5_D D D=v=Um-JCFW it 'should ', ->5_E#D D=v=UmEEGY EGX5_FGG4v4UmLEGY preStyles = FGY5_FGG4v4UmNEGY4 preStyles = spanCalculate({post: 1, columns: 1})5_J!GG4v4UmPJLYJKY5_ K K KvUmQJLZE expect(postStyles.marginRight).to.equal(squishStyles.marginRight)5_  K K KvUmRJLZA expect(Styles.marginRight).to.equal(squishStyles.marginRight)5_   KK KvUmTJLZD expect(preStyles.marginRight).to.equal(squishStyles.marginRight)5_   K7K KvUmWKJLZC expect(preStyles.marginLeft).to.equal(squishStyles.marginRight)5_   QK KvUmkLPQ5 expect(styles.marginRight).to.equal(styles.width)5_  QK KvUmPQ: expect(styles.marginRight).to.equal(styles.marginLeft)5_ Q/K KvUmPRX1 expect(noSquishstyles.marginLeft).to.equal(0)5_Q1K KvUmMPRX2 expect(noSquishstyles.marginLeft).to.equal("0)5_KU<KNY KMX5_MUYLM6 it 'should accept an array as an argument for squish5_MUZNLM5_KKFVVcKRXKLX5_LKFVVcKM^5_M$KFVVcLN_3 preStyles = spanCalculate({pre: 1, columns: 1})5_N&KFVVcMO_5 postStyles = spanCalculate({post: 1, columns: 1})5_M0KFVVc"LN_3 preStyles = spanCalculate({pre: 2, columns: 1})5_N2KFVVc#MO_5 postStyles = spanCalculate({post: 2, columns: 1})5_O*KFVVc$NP_9 squishStyles = spanCalculate({squish: 1, columns: 1})5_O6KFVVc)ONP_9 squishStyles = spanCalculate({squish: 2, columns: 1})5_R7SD7V7VcCRc_RS_5_ScD7V7VcCRTo5_TTU#v#Vc^SUp? it 'should produce the same output for marginRight/marginLeft) for squish as it does for pre/post', ->5_ TTT)v#Vc_SUo it '', ->5_! UU2V5V7Vc TU3 preStyles = spanCalculate({pre: 1, columns: 1})5 postStyles = spanCalculate({post: 1, columns: 1})5_ "!U7U2U5V7Vc TVm9 squishStyles = spanCalculate({squish: 1, columns: 1})5_!#"U7U2U5V7VcUWmUVm5_"$#VU2U5V7VcUWn: squishStyles = spanCalculate({squish: 1, columns: 12})5_#%$VU2U5V7VcUWn= bigsquishStyles = spanCalculate({squish: 1, columns: 12})5_$&%V-U2U5V7VcUWn= bigSquishStyles = spanCalculate({squish: 1, columns: 12})5_%'&[[-`-V-VcZ[3 preStyles = spanCalculate({pre: 2, columns: 2})5 postStyles = spanCalculate({post: 2, columns: 2})9 squishStyles = spanCalculate({squish: 2, columns: 2})E expect(postStyles.marginRight).to.equal(squishStyles.marginRight)B expect(preStyles.marginLeft).to.equal(squishStyles.marginLeft)5_&('Z[-[-V-VcYZ5_')(ZZ-Z-V-Vc YZ5_()VZ-Z-V-Vc!PVXg VXf5_Q7cD7V7VcBQR_QR_? it 'should produce the same output for marginRight/marginLeft) for squish as it does for pre/post', ->3 preStyles = spanCalculate({pre: 1, columns: 1})5 postStyles = spanCalculate({post: 1, columns: 1})9 squishStyles = spanCalculate({squish: 1, columns: 1})E expect(postStyles.marginRight).to.equal(squishStyles.marginRight)B expect(preStyles.marginLeft).to.equal(squishStyles.marginLeft)3 preStyles = spanCalculate({pre: 2, columns: 2})5 postStyles = spanCalculate({post: 2, columns: 2})9 squishStyles = spanCalculate({squish: 2, columns: 2})E expect(postStyles.marginRight).to.equal(squishStyles.marginRight)B expect(preStyles.marginLeft).to.equal(squishStyles.marginLeft)5_:7/VU9<8:>5_:7/VU9;@1 styles = spanCalculate({squi: 1, columns: 3})5_8:9 ';v;T  5_   vT|  5