Add test cases for stackChanged() event