@@ -87,6 +87,22 @@ describe('<select multiple selectize>', function() {
8787 mousedownClickMouseup ( selectize . $dropdown_content . find ( '[data-value="' + 2 + '"]' ) ) ;
8888 assert . deepEqual ( scope . selection , [ 'foo' , 'baz' ] ) ;
8989 } ) ;
90+
91+ it ( 'should have the correct remaining options' , function ( ) {
92+ assert . strictEqual ( selectize . $dropdown_content . children ( ) . length , scope . options . length - scope . selection . length ) ;
93+ selectize . open ( ) ;
94+ mousedownClickMouseup ( selectize . $dropdown_content . find ( '[data-value="' + 2 + '"]' ) ) ;
95+ timeout . flush ( ) ;
96+ assert . strictEqual ( selectize . $dropdown_content . children ( ) . length , scope . options . length - scope . selection . length ) ;
97+ } ) ;
98+
99+ it ( 'should not change the options on scope' , function ( ) {
100+ var options = angular . copy ( scope . options ) ;
101+ selectize . open ( ) ;
102+ mousedownClickMouseup ( selectize . $dropdown_content . find ( '[data-value="' + 2 + '"]' ) ) ;
103+ timeout . flush ( ) ;
104+ assert . deepEqual ( scope . options , options ) ;
105+ } ) ;
90106 } ) ;
91107
92108 describe ( 'when a new option is added' , function ( ) {
@@ -213,6 +229,22 @@ describe('<select multiple selectize>', function() {
213229 mousedownClickMouseup ( selectize . $dropdown_content . find ( '[data-value="' + 2 + '"]' ) ) ;
214230 assert . deepEqual ( scope . selection , [ 'guid1' , 'guid3' ] ) ;
215231 } ) ;
232+
233+ it ( 'should have the correct remaining options' , function ( ) {
234+ assert . strictEqual ( selectize . $dropdown_content . children ( ) . length , scope . options . length - scope . selection . length ) ;
235+ selectize . open ( ) ;
236+ mousedownClickMouseup ( selectize . $dropdown_content . find ( '[data-value="' + 2 + '"]' ) ) ;
237+ timeout . flush ( ) ;
238+ assert . strictEqual ( selectize . $dropdown_content . children ( ) . length , scope . options . length - scope . selection . length ) ;
239+ } ) ;
240+
241+ it ( 'should not change the options on scope' , function ( ) {
242+ var options = angular . copy ( scope . options ) ;
243+ selectize . open ( ) ;
244+ mousedownClickMouseup ( selectize . $dropdown_content . find ( '[data-value="' + 2 + '"]' ) ) ;
245+ timeout . flush ( ) ;
246+ assert . deepEqual ( scope . options , options ) ;
247+ } ) ;
216248 } ) ;
217249
218250 describe ( 'when a new option is added' , function ( ) {
0 commit comments