Add test for clear functionality