From a3a83e60d5e0f2232a3a5e0e5cb51e19771d03cb Mon Sep 17 00:00:00 2001 From: Aditya_Unnithan_ONS Date: Tue, 14 Nov 2023 14:24:58 +0000 Subject: [PATCH] Remove old test for input js --- src/components/input/_macro.spec.js | 18 ------------------ src/components/input/input.spec.js | 4 ++-- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/components/input/_macro.spec.js b/src/components/input/_macro.spec.js index 1ac316a630..e02ebd7535 100644 --- a/src/components/input/_macro.spec.js +++ b/src/components/input/_macro.spec.js @@ -424,24 +424,6 @@ describe('macro: input', () => { expect($('.ons-input-type--prefix .ons-js-input-abbr').text().trim()).toBe('Example prefix text'); }); - // it('focuses input when abbreviation is clicked', async () => { - // const $ = cheerio.load( - // renderComponent('input', { - // ...EXAMPLE_INPUT_MINIMAL, - // prefix: { - // id: 'example-prefix-id', - // title: 'Example prefix title', - // text: 'Example prefix text', - // }, - // }), - // ); - - // await page.$('.ons-js-input-abbr').click(); - // const focusedElementId = await page.evaluate(() => document.activeElement.id); - - // expect($(focusedElementId).attr('id')).toBe('example-prefix-id'); - // }); - it('does not render prefix element when `prefix.id` not set', () => { const $ = cheerio.load( renderComponent('input', { diff --git a/src/components/input/input.spec.js b/src/components/input/input.spec.js index e928c03411..794fa81abc 100644 --- a/src/components/input/input.spec.js +++ b/src/components/input/input.spec.js @@ -22,7 +22,7 @@ describe('script: input', () => { }), ); await page.click('.ons-js-input-abbr'); - const focusedElementId = await page.evaluate(() => document.activeElement.id === 'example-id'); - expect(focusedElementId).toBe(true); + const focusedElementId = await page.evaluate(() => document.activeElement.id); + expect(focusedElementId).toEqual('example-id'); }); });