diff --git a/packages/ui-components/src/__tests__/InputToken.test.ts b/packages/ui-components/src/__tests__/InputToken.test.ts new file mode 100644 index 000000000..2840a4064 --- /dev/null +++ b/packages/ui-components/src/__tests__/InputToken.test.ts @@ -0,0 +1,16 @@ +import { render } from '@testing-library/svelte'; +import InputToken from '../lib/components/input/InputToken.svelte'; + + +describe('InputToken', () => { + it('renders with initial values', () => { + const address = '0xc0D477556c25C9d67E1f57245C7453DA776B51cf'; + const decimals = 10; + const { getByTestId } = render(InputToken, { props: { address, decimals } }); + + const input = getByTestId('token-address-input').querySelector('input'); + expect(input?.value).toBe('0xc0D477556c25C9d67E1f57245C7453DA776B51cf'); + const decimalsInput = getByTestId('token-decimals-input').querySelector('input'); + expect(decimalsInput?.value).toBe('10'); + }); +}); diff --git a/packages/ui-components/src/lib/components/input/InputToken.svelte b/packages/ui-components/src/lib/components/input/InputToken.svelte index fe16865e4..c661b3db8 100644 --- a/packages/ui-components/src/lib/components/input/InputToken.svelte +++ b/packages/ui-components/src/lib/components/input/InputToken.svelte @@ -37,7 +37,7 @@