But you aren't testing what the test claims, and further you are testing the internals and not the input and output of the function call. The test calls to shrink the menu if there are not enough items to scroll. Therefore I would expect to see setting the number of items less than the size, and then asserting that the menu has indeed been shrunk.