Skip to content

Commit

Permalink
adding color picker tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Feb 2, 2023
1 parent 0d7854f commit b4b3ea5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_color_input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from selenium.webdriver.common.keys import Keys

from nicegui import ui

from .screen import Screen


def test_entering_color(screen: Screen):
ui.color_input(label='Color', on_change=lambda e: ui.label(f'content: {e.value}'))

screen.open('/')
screen.type(Keys.TAB)
screen.type('#001100')
screen.should_contain('content: #001100')


def test_picking_color(screen: Screen):
ui.color_input(label='Color', on_change=lambda e: ui.label(f'content: {e.value}'))

screen.open('/')
picker = screen.click('colorize')
screen.click_at_position(picker, x=40, y=120)
screen.should_contain('content: #de8383')

0 comments on commit b4b3ea5

Please sign in to comment.