@@ -80,12 +80,6 @@ function createMockNode() {
8080 } ;
8181}
8282
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- = === ===
8983function createMountedDOMElement ( ) {
9084 var node = createMockNode ( ) ;
9185 var domElement = new DOMElement ( node ) ;
@@ -241,7 +235,6 @@ test('DOMElement', function(t) {
241235
242236 t . equal ( typeof domElement . onDismount , 'function' , 'DOMElement#onDismount should be a function' ) ;
243237
244- > >>> >>> fix: Refactor DOMElement
245238 t . end ( ) ;
246239 } ) ;
247240
@@ -260,30 +253,6 @@ test('DOMElement', function(t) {
260253 ) ;
261254
262255 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- =======
287256 } ) ;
288257
289258 t . test ( 'onHide method' , function ( t ) {
@@ -334,7 +303,6 @@ test('DOMElement', function(t) {
334303 t . equal ( typeof domElement . onTransformChange , 'function' , 'DOMElement#onTransformChange should be a function' ) ;
335304
336305 domElement . onTransformChange ( [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ] ) ;
337- >>>>>>> fix: Refactor DOMElement
338306
339307 t . deepEqual (
340308 domElement . _node . sentDrawCommands ,
@@ -357,15 +325,9 @@ test('DOMElement', function(t) {
357325 domElement . onUpdate ( ) ;
358326
359327 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- =======
365328 domElement . _node . sentDrawCommands ,
366329 [ 'WITH' , 'body/0' , 'CHANGE_SIZE' , false , 200 ] ,
367330 'DOMElement#onSizeChange should send false as size if render sized'
368- >>>>>>> fix: Refactor DOMElement
369331 ) ;
370332
371333 t . end ( ) ;
@@ -384,27 +346,14 @@ test('DOMElement', function(t) {
384346 [ 'WITH' , 'body/0' , 'CHANGE_PROPERTY' , 'opacity' , 0.5 ] ,
385347 'DOMElement#onOpacityChange should send correct draw commands'
386348 ) ;
387- <<<<<<< HEAD
388- */
389- = === ===
390- >>> >>> > fix: Refactor DOMElement
391349
392350 t . end ( ) ;
393351 } ) ;
394352
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- =======
403353 t . test ( 'onAddUIEvent method' , function ( t ) {
404354 var domElement = createMountedDOMElement ( ) ;
405355
406356 t . equal ( typeof domElement . onAddUIEvent , 'function' , 'DOMElement#onAddUIEvent should be a function' ) ;
407- >>>>>>> fix: Refactor DOMElement
408357
409358 domElement . onAddUIEvent ( 'click' ) ;
410359 domElement . onUpdate ( ) ;
@@ -548,29 +497,6 @@ test('DOMElement', function(t) {
548497 ) ;
549498
550499 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- = === ===
574500
575501 domElement . addClass ( 'class-2' ) ;
576502 domElement . onUpdate ( ) ;
@@ -588,7 +514,6 @@ test('DOMElement', function(t) {
588514 var domElement = createMountedDOMElement ( ) ;
589515
590516 t . equal ( typeof domElement . removeClass , 'function' , 'DOMElement#removeClass should be a function' ) ;
591- > >>> >>> fix: Refactor DOMElement
592517
593518 domElement . removeClass ( 'not-added' ) ;
594519 domElement . onUpdate ( ) ;
@@ -630,43 +555,6 @@ test('DOMElement', function(t) {
630555
631556 t . equal ( typeof domElement . getClasses , 'function' , 'DOMElement#getClasses should be a function' ) ;
632557
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- = === ===
670558 t . deepEqual ( domElement . getClasses ( ) , [ 'famous-dom-element' ] , 'DOMElement#getClasses should have a famous-dom-element class in it' ) ;
671559
672560 domElement . addClass ( 'class-1' ) ;
@@ -826,6 +714,5 @@ test('DOMElement', function(t) {
826714 domElement . onReceive ( 'resize' , resizePayload ) ;
827715
828716 t . deepEqual ( domElement . getValue ( ) . renderSize , [ 100 , 200 ] ) ;
829- > >>> >>> fix: Refactor DOMElement
830717 } ) ;
831718} ) ;
0 commit comments