@@ -80,12 +80,6 @@ function createMockNode() {
80
80
} ;
81
81
}
82
82
83
- << < << << HEAD
84
- test ( 'DOMElement' , function ( t ) {
85
- t . test ( 'constructor (default options)' , function ( t ) {
86
- t . equal ( typeof DOMElement , 'function' , 'DOMElement should be a constructor function' ) ;
87
-
88
- = === ===
89
83
function createMountedDOMElement ( ) {
90
84
var node = createMockNode ( ) ;
91
85
var domElement = new DOMElement ( node ) ;
@@ -241,7 +235,6 @@ test('DOMElement', function(t) {
241
235
242
236
t . equal ( typeof domElement . onDismount , 'function' , 'DOMElement#onDismount should be a function' ) ;
243
237
244
- > >>> >>> fix: Refactor DOMElement
245
238
t . end ( ) ;
246
239
} ) ;
247
240
@@ -260,30 +253,6 @@ test('DOMElement', function(t) {
260
253
) ;
261
254
262
255
t . end ( ) ;
263
- < << << << HEAD
264
- } ) ;
265
-
266
- t . test ( 'should get initial spec from node' , function ( t ) {
267
- /*
268
- var node = createMockNode(t);
269
-
270
- node.sentDrawCommands = ['EXISTING', 'DRAW', 'COMMANDS'];
271
- node.shown = false;
272
- node.location = 'body/4/45/4/5';
273
- node.transform = [
274
- 0.5, 0, 0, 0,
275
- 0, 0.5, 0, 0,
276
- 0, 0, 0.5, 0,
277
- 0, 0, 0, 0.5
278
- ];
279
- node.size = [100, 200, 300];
280
- node.sizeMode = [1, 1, 1];
281
- node.uiEvents = [];
282
- node.opacity = 0.4;
283
-
284
- var domElement = new DOMElement(node);
285
- domElement.onMount(node, 3);
286
- =======
287
256
} ) ;
288
257
289
258
t . test ( 'onHide method' , function ( t ) {
@@ -334,7 +303,6 @@ test('DOMElement', function(t) {
334
303
t . equal ( typeof domElement . onTransformChange , 'function' , 'DOMElement#onTransformChange should be a function' ) ;
335
304
336
305
domElement . onTransformChange ( [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ] ) ;
337
- >>>>>>> fix: Refactor DOMElement
338
306
339
307
t . deepEqual (
340
308
domElement . _node . sentDrawCommands ,
@@ -357,15 +325,9 @@ test('DOMElement', function(t) {
357
325
domElement . onUpdate ( ) ;
358
326
359
327
t . deepEqual (
360
- <<<<<<< HEAD
361
- node.sentDrawCommands,
362
- 'should send initial styles on first update. Should take into ' +
363
- 'account size, UI Events etc. from Node'
364
- =======
365
328
domElement . _node . sentDrawCommands ,
366
329
[ 'WITH' , 'body/0' , 'CHANGE_SIZE' , false , 200 ] ,
367
330
'DOMElement#onSizeChange should send false as size if render sized'
368
- >>>>>>> fix: Refactor DOMElement
369
331
) ;
370
332
371
333
t . end ( ) ;
@@ -384,27 +346,14 @@ test('DOMElement', function(t) {
384
346
[ 'WITH' , 'body/0' , 'CHANGE_PROPERTY' , 'opacity' , 0.5 ] ,
385
347
'DOMElement#onOpacityChange should send correct draw commands'
386
348
) ;
387
- <<<<<<< HEAD
388
- */
389
- = === ===
390
- >>> >>> > fix: Refactor DOMElement
391
349
392
350
t . end ( ) ;
393
351
} ) ;
394
352
395
- < << << << HEAD
396
- t . test ( 'onMount, onUpdate, onDismount lifecyle' , function ( t ) {
397
- // t.plan(12);
398
-
399
- /*
400
- var node = createMockNode(t);
401
- var domElement = new DOMElement(node);
402
- =======
403
353
t . test ( 'onAddUIEvent method' , function ( t ) {
404
354
var domElement = createMountedDOMElement ( ) ;
405
355
406
356
t . equal ( typeof domElement . onAddUIEvent , 'function' , 'DOMElement#onAddUIEvent should be a function' ) ;
407
- >>>>>>> fix: Refactor DOMElement
408
357
409
358
domElement . onAddUIEvent ( 'click' ) ;
410
359
domElement . onUpdate ( ) ;
@@ -548,29 +497,6 @@ test('DOMElement', function(t) {
548
497
) ;
549
498
550
499
node . sentDrawCommands . length = 0 ;
551
- <<<<<<< HEAD
552
- domElement.onUpdate();
553
- t.deepEqual(
554
- node.sentDrawCommands,
555
- [ 'WITH', 'body/3', 'DOM', 'CHANGE_SIZE', 0, 0, 'CHANGE_PROPERTY', 'display', true, 'CHANGE_PROPERTY', 'opacity', 1, 'CHANGE_PROPERTY', 'position', 'absolute', 'CHANGE_PROPERTY', '-webkit-transform-origin', '0% 0%', 'CHANGE_PROPERTY', 'transform-origin', '0% 0%', 'CHANGE_PROPERTY', '-webkit-backface-visibility', 'visible', 'CHANGE_PROPERTY', 'backface-visibility', 'visible', 'CHANGE_PROPERTY', '-webkit-transform-style', 'preserve-3d', 'CHANGE_PROPERTY', 'transform-style', 'preserve-3d', 'CHANGE_PROPERTY', '-webkit-tap-highlight-color', 'transparent', 'CHANGE_PROPERTY', 'pointer-events', 'auto', 'CHANGE_PROPERTY', 'z-index', '1', 'CHANGE_PROPERTY', 'box-sizing', 'border-box', 'CHANGE_PROPERTY', '-moz-box-sizing', 'border-box', 'CHANGE_PROPERTY', '-webkit-box-sizing', 'border-box', 'CHANGE_ATTRIBUTE', 'data-fa-path', 'body/0' ],
556
- 'should send initial styles on first update'
557
- );
558
- node.sentDrawCommands.length = 0;
559
- domElement.onUpdate();
560
- t.deepEqual(
561
- node.sentDrawCommands,
562
- [ 'WITH', 'body/0', 'CHANGE_ATTRIBUTE', 'data-fa-path', '', 'GL_CUTOUT_STATE', false],
563
- 'Dismounting the node should result into the DOMElement being ' +
564
- 'hidden'
565
- );
566
- */
567
- t . end ( ) ;
568
- } ) ;
569
-
570
- t . test ( 'on, onReceive method' , function ( t ) {
571
- var node = createMockNode ( t ) ;
572
- var domElement = new DOMElement ( node ) ;
573
- = === ===
574
500
575
501
domElement . addClass ( 'class-2' ) ;
576
502
domElement . onUpdate ( ) ;
@@ -588,7 +514,6 @@ test('DOMElement', function(t) {
588
514
var domElement = createMountedDOMElement ( ) ;
589
515
590
516
t . equal ( typeof domElement . removeClass , 'function' , 'DOMElement#removeClass should be a function' ) ;
591
- > >>> >>> fix: Refactor DOMElement
592
517
593
518
domElement . removeClass ( 'not-added' ) ;
594
519
domElement . onUpdate ( ) ;
@@ -630,43 +555,6 @@ test('DOMElement', function(t) {
630
555
631
556
t . equal ( typeof domElement . getClasses , 'function' , 'DOMElement#getClasses should be a function' ) ;
632
557
633
- < << << << HEAD
634
- domElement . onReceive ( 'some event' , actualEvent ) ;
635
- t . end ( ) ;
636
- } ) ;
637
-
638
- t . test ( 'setContent method' , function ( t ) {
639
- var node = createMockNode ( t ) ;
640
- var domElement = new DOMElement ( node ) ;
641
- t . equal (
642
- typeof domElement . setContent ,
643
- 'function' ,
644
- 'domElement.setContent should be a function'
645
- ) ;
646
-
647
- // domElement.onMount(node, 0);
648
- t . doesNotThrow ( function ( ) {
649
- domElement . setContent ( 'some content' ) ;
650
- } , 'should not error when passed a String' ) ;
651
-
652
- t . end ( ) ;
653
- } ) ;
654
-
655
- t . test ( 'setProperty method' , function ( t ) {
656
- var node = createMockNode ( t ) ;
657
- var domElement = new DOMElement ( node ) ;
658
- t . equal (
659
- typeof domElement . setProperty ,
660
- 'function' ,
661
- 'domElement.setProperty should be a function'
662
- ) ;
663
-
664
- t . doesNotThrow ( function ( ) {
665
- domElement . setProperty ( 'background' , 'red' ) ;
666
- } , 'should not fail when passed a key value pair' ) ;
667
-
668
- t . end ( ) ;
669
- = === ===
670
558
t . deepEqual ( domElement . getClasses ( ) , [ 'famous-dom-element' ] , 'DOMElement#getClasses should have a famous-dom-element class in it' ) ;
671
559
672
560
domElement . addClass ( 'class-1' ) ;
@@ -826,6 +714,5 @@ test('DOMElement', function(t) {
826
714
domElement . onReceive ( 'resize' , resizePayload ) ;
827
715
828
716
t . deepEqual ( domElement . getValue ( ) . renderSize , [ 100 , 200 ] ) ;
829
- > >>> >>> fix: Refactor DOMElement
830
717
} ) ;
831
718
} ) ;
0 commit comments