File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -4265,6 +4265,17 @@ describe('Sorted Row Ids', () => {
42654265} ) ;
42664266
42674267describe ( 'Miscellaneous' , ( ) => {
4268+ test ( 'Listener cannot mutate original store' , ( ) => {
4269+ queries . setQueryDefinition ( 'q1' , 't1' , ( { select} ) => select ( 'c1' ) ) ;
4270+ queries . addResultTableListener ( 'q1' , ( ) => {
4271+ store . setValue ( 'mutated' , true ) ;
4272+ } ) ;
4273+ store . setCell ( 't1' , 'r1' , 'c1' , 1 ) ;
4274+ expect ( store . getTables ( ) ) . toEqual ( { t1 : { r1 : { c1 : 1 } } } ) ;
4275+ expect ( queries . getResultTable ( 'q1' ) ) . toEqual ( { r1 : { c1 : 1 } } ) ;
4276+ expect ( store . getValues ( ) ) . toEqual ( { } ) ;
4277+ } ) ;
4278+
42684279 test ( 'cleans results when deleted' , ( ) => {
42694280 setCells ( ) ;
42704281 queries . setQueryDefinition ( 'q1' , 't1' , ( { select} ) => select ( 'c1' ) ) ;
You can’t perform that action at this time.
0 commit comments