Generate relevant test cases for the following function or UI code. Prefer Playwright or Jest: ```js {{input}} ```