import { Platform } from 'react-native';
import sinon from 'sinon';

describe('Keyboard behavior', function () {
  afterEach(function () {
    jest.resetModules();
  });

  it('is set to height for Android', function () {
    const selectStub = sinon.stub(Platform, 'select').callsFake((init) => init.android);

    const { keyboardBehavior } = require('./keyboard');

    expect(keyboardBehavior).toBe('height');

    selectStub.restore();
  });

  it('is set to padding for iOS', function () {
    const selectStub = sinon.stub(Platform, 'select').callsFake((init) => init.ios);

    const { keyboardBehavior } = require('./keyboard');

    expect(keyboardBehavior).toBe('padding');

    selectStub.restore();
  });
});
