import { expect, it, vi } from "vitest";
import BalanceInput from "../../components/BalanceInput/BalanceInput";
import { renderWithProvider } from "../../testHelpers";
const handleChange = vi.fn();
it("renders correctly", () => {
const { asFragment } = renderWithProvider(
);
expect(asFragment()).toMatchInlineSnapshot(`
.c2 {
width: 100%;
}
.c1 {
display: flex;
justify-content: flex-end;
}
.c3 {
display: flex;
}
.c4 {
display: flex;
align-items: center;
}
.c7 {
color: var(--colors-textSubtle);
font-weight: 400;
line-height: 1.5;
font-size: 12px;
text-align: right;
}
.c5 {
background-color: var(--colors-input);
border-radius: 16px;
box-shadow: var(--shadows-inset);
color: var(--colors-text);
display: block;
font-size: 16px;
height: 40px;
outline: 0;
padding: 0 16px;
width: 100%;
border: 1px solid var(--colors-inputSecondary);
}
.c5::placeholder {
color: var(--colors-textSubtle);
}
.c5:disabled {
background-color: var(--colors-backgroundDisabled);
box-shadow: none;
color: var(--colors-textDisabled);
cursor: not-allowed;
}
.c5:focus:not(:disabled) {
box-shadow: var(--shadows-focus);
}
.c0 {
background-color: var(--colors-input);
border: 1px solid var(--colors-inputSecondary);
border-radius: 16px;
box-shadow: var(--shadows-inset);
padding: 8px 16px;
}
.c6 {
background: transparent;
border-radius: 0;
box-shadow: none;
padding-left: 0;
padding-right: 0;
text-align: right;
border: none;
}
.c6 ::placeholder {
color: var(--colors-textSubtle);
}
.c6:focus:not(:disabled) {
box-shadow: none;
}
`);
});
it("renders correctly with unit prop", () => {
const { asFragment } = renderWithProvider(
);
expect(asFragment()).toMatchInlineSnapshot(`
.c2 {
width: 100%;
}
.c1 {
display: flex;
justify-content: flex-end;
}
.c3 {
display: flex;
}
.c4 {
display: flex;
align-items: center;
}
.c7 {
color: var(--colors-text);
font-weight: 400;
line-height: 1.5;
font-size: 16px;
}
.c9 {
color: var(--colors-textSubtle);
font-weight: 400;
line-height: 1.5;
font-size: 12px;
text-align: right;
}
.c5 {
background-color: var(--colors-input);
border-radius: 16px;
box-shadow: var(--shadows-inset);
color: var(--colors-text);
display: block;
font-size: 16px;
height: 40px;
outline: 0;
padding: 0 16px;
width: 100%;
border: 1px solid var(--colors-inputSecondary);
}
.c5::placeholder {
color: var(--colors-textSubtle);
}
.c5:disabled {
background-color: var(--colors-backgroundDisabled);
box-shadow: none;
color: var(--colors-textDisabled);
cursor: not-allowed;
}
.c5:focus:not(:disabled) {
box-shadow: var(--shadows-focus);
}
.c8 {
margin-left: 4px;
text-align: right;
color: var(--colors-textSubtle);
white-space: nowrap;
}
.c0 {
background-color: var(--colors-input);
border: 1px solid var(--colors-inputSecondary);
border-radius: 16px;
box-shadow: var(--shadows-inset);
padding: 8px 16px;
}
.c6 {
background: transparent;
border-radius: 0;
box-shadow: none;
padding-left: 0;
padding-right: 0;
text-align: right;
border: none;
}
.c6 ::placeholder {
color: var(--colors-textSubtle);
}
.c6:focus:not(:disabled) {
box-shadow: none;
}
`);
});
it("renders correctly with unit prop and switchEditingUnits", () => {
const { asFragment } = renderWithProvider(
);
expect(asFragment()).toMatchInlineSnapshot(`
.c2 {
width: 100%;
}
.c10 {
padding-left: 12px;
}
.c1 {
display: flex;
justify-content: flex-end;
}
.c3 {
display: flex;
}
.c4 {
display: flex;
align-items: center;
}
.c14 {
align-self: center;
fill: var(--colors-textSubtle);
color: var(--colors-textSubtle);
flex-shrink: 0;
}
.c7 {
color: var(--colors-text);
font-weight: 400;
line-height: 1.5;
font-size: 16px;
}
.c9 {
color: var(--colors-textSubtle);
font-weight: 400;
line-height: 1.5;
font-size: 12px;
text-align: right;
}
.c5 {
background-color: var(--colors-input);
border-radius: 16px;
box-shadow: var(--shadows-inset);
color: var(--colors-text);
display: block;
font-size: 16px;
height: 40px;
outline: 0;
padding: 0 16px;
width: 100%;
border: 1px solid var(--colors-inputSecondary);
}
.c5::placeholder {
color: var(--colors-textSubtle);
}
.c5:disabled {
background-color: var(--colors-backgroundDisabled);
box-shadow: none;
color: var(--colors-textDisabled);
cursor: not-allowed;
}
.c5:focus:not(:disabled) {
box-shadow: var(--shadows-focus);
}
.c11 {
position: relative;
align-items: center;
border: 0;
border-radius: 16px;
box-shadow: 0px -1px 0px 0px rgba(14, 14, 44, 0.4) inset;
cursor: pointer;
display: inline-flex;
font-family: inherit;
font-size: 16px;
font-weight: 600;
justify-content: center;
letter-spacing: 0.03em;
line-height: 1;
opacity: 1;
outline: 0;
transition: background-color 0.2s,opacity 0.2s;
height: 32px;
padding: 0 16px;
background-color: transparent;
color: var(--colors-primary);
box-shadow: none;
}
.c11:focus-visible {
outline: none;
box-shadow: var(--shadows-focus);
}
.c11:active:not(:disabled):not(.plexswap-button--disabled):not(.plexswap-button--disabled) {
opacity: 0.85;
transform: translateY(1px);
box-shadow: none;
}
.c11:disabled,
.c11.plexswap-button--disabled {
background-color: var(--colors-backgroundDisabled);
border-color: var(--colors-backgroundDisabled);
box-shadow: none;
color: var(--colors-textDisabled);
cursor: not-allowed;
}
.c12 {
padding: 2px;
width: 32px;
}
.c13 {
width: 16px;
}
.c8 {
margin-left: 4px;
text-align: right;
color: var(--colors-textSubtle);
white-space: nowrap;
}
.c0 {
background-color: var(--colors-input);
border: 1px solid var(--colors-inputSecondary);
border-radius: 16px;
box-shadow: var(--shadows-inset);
padding: 8px 16px;
}
.c6 {
background: transparent;
border-radius: 0;
box-shadow: none;
padding-left: 0;
padding-right: 0;
text-align: right;
border: none;
}
.c6 ::placeholder {
color: var(--colors-textSubtle);
}
.c6:focus:not(:disabled) {
box-shadow: none;
}
@supports (-webkit-text-size-adjust: none) and (not (-ms-accelerator: true)) and (not (-moz-appearance: none)) {
.c14 {
filter: none!important;
}
}
@media (hover: hover) {
.c11:hover:not(:disabled):not(.plexswap-button--disabled):not(.plexswap-button--disabled):not(:active) {
opacity: 0.65;
}
}
`);
});