message: test(number-input): added more test cases for number-input
diff: @@ -4,6 +4,7 @@ import {
  render,
  renderHook,
  userEvent,
  + press,
  } from "@chakra-ui/test-utils"
  import * as React from "react"
  import {
  @@ -69,6 +70,91 @@ test("should increment on press increment button", () => {
  expect(input).toHaveValue("2")
  })
  +test("should increase/decrease with keyboard", () => {
  + const { getByTestId } = renderComponent()
  +
  + const input = getByTestId("input")
  +
  + input.focus()
  +
  + press.ArrowUp(input)
  + press.ArrowUp(input)
  + press.ArrowUp(input)
  + expect(input).toHaveValue("3")
  +
  + press.ArrowDown(input)
  + press.ArrowDown(input)
  + press.ArrowDown(input)
  + expect(input).toHaveValue("0")
  +
  + press.ArrowUp(input)
  + expect(input).toHaveValue("1")
  +
  + press.Home(input)
  + expect(input).toHaveValue("-9007199254740991")
  +
  + press.End(input)
  + expect(input).toHaveValue("9007199254740991")
  +})
  +
  +test("should increase/decrease by 10*step on shift+Arrow", () => {
  + const { getByTestId } = renderComponent({ defaultValue: 0 })
  +
  + const input = getByTestId("input")
  +
  + press.ArrowUp(input)
  + expect(input).toHaveValue("1")
  + press.ArrowUp(input, { shiftKey: true })
  + expect(input).toHaveValue("11")
  +
  + press.ArrowDown(input, { shiftKey: true })
  + expect(input).toHaveValue("1")
  + press.ArrowDown(input)
  + expect(input).toHaveValue("0")
  +})
  +
  +test("should increase/decrease by 0.1*step on ctrl+Arrow", () => {
  + const { getByTestId } = renderComponent({
  + defaultValue: 0,
  + step: 0.1,
  + precision: 2,
  + })
  +
  + const input = getByTestId("input")
  +
  + press.ArrowUp(input)
  + expect(input).toHaveValue("0.10")
  + press.ArrowUp(input, { ctrlKey: true })
  + expect(input).toHaveValue("0.11")
  +
  + press.ArrowDown(input, { ctrlKey: true })
  + expect(input).toHaveValue("0.10")
  + press.ArrowDown(input)
  + expect(input).toHaveValue("0.00")
  +})
  +
  +it("should behave properly precision value", () => {
  + const { getByTestId } = renderComponent({
  + defaultValue: 0,
  + step: 0.65,
  + precision: 2,
  + })
  +
  + const input = getByTestId("input")
  + const incBtn = getByTestId("up-btn")
  + const decBtn = getByTestId("down-btn")
  +
  + expect(input).toHaveValue("0.00")
  + userEvent.click(incBtn)
  + expect(input).toHaveValue("0.65")
  + userEvent.click(incBtn)
  + expect(input).toHaveValue("1.30")
  + userEvent.click(incBtn)
  + expect(input).toHaveValue("1.95")
  + userEvent.click(decBtn)
  + expect(input).toHaveValue("1.30")
  +})
  +
  test("should call onChange on value change", () => {
  const onChange = jest.fn()
  const { getByTestId } = renderComponent({ onChange })
  