|
|
@@ -687,6 +687,23 @@ describe( 'Model', () => {
|
|
|
}
|
|
|
);
|
|
|
} );
|
|
|
+
|
|
|
+ it( 'should fire a single change event per bound attribute', () => {
|
|
|
+ const vehicle = new Car();
|
|
|
+ const car = new Car( { color: 'red', year: 1943 } );
|
|
|
+ const spy = bender.sinon.spy();
|
|
|
+
|
|
|
+ vehicle.on( 'change', spy );
|
|
|
+
|
|
|
+ vehicle.bind( 'color', 'year' ).to( car );
|
|
|
+
|
|
|
+ car.color = 'violet';
|
|
|
+ car.custom = 'foo';
|
|
|
+ car.year = 2001;
|
|
|
+
|
|
|
+ expect( spy.args.map( args => args[ 1 ] ) )
|
|
|
+ .to.have.members( [ 'color', 'year', 'color', 'year' ] );
|
|
|
+ } );
|
|
|
} );
|
|
|
} );
|
|
|
|