-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for imputToken to check it renders with correct initial value
- Loading branch information
1 parent
c59e27e
commit bbd057f
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters