mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
36 lines
1022 B
TypeScript
36 lines
1022 B
TypeScript
/* eslint-disable import/no-extraneous-dependencies */
|
|
import { expect } from 'chai';
|
|
import Sinon from 'sinon';
|
|
import { TestUtils } from '../test-utils';
|
|
import { findAllByTagName, renderComponent } from './renderComponent';
|
|
import { SimpleSessionInput } from '../../components/inputs/SessionInput';
|
|
|
|
describe('SessionInput', () => {
|
|
beforeEach(() => {
|
|
TestUtils.stubSVGElement();
|
|
TestUtils.stubWindowLog();
|
|
});
|
|
|
|
afterEach(() => {
|
|
Sinon.restore();
|
|
});
|
|
|
|
it('should render an input', async () => {
|
|
const result = renderComponent(
|
|
<SimpleSessionInput
|
|
type="text"
|
|
errorDataTestId={null as any}
|
|
onEnterPressed={null as any}
|
|
onValueChanged={null as any}
|
|
providedError={null as any}
|
|
/>
|
|
);
|
|
|
|
// Using findAllByTagName to find input elements by tag name
|
|
const inputElements = findAllByTagName<HTMLInputElement>(result, 'input');
|
|
expect(inputElements.length, 'should have an input element').to.equal(1);
|
|
|
|
result.unmount();
|
|
});
|
|
});
|