Coder Social home page Coder Social logo

Internal Test suite about anvil-extras HOT 3 CLOSED

anvilistas avatar anvilistas commented on June 23, 2024
Internal Test suite

from anvil-extras.

Comments (3)

meatballs avatar meatballs commented on June 23, 2024

Is there something you don't like about the (admittedly insufficient) existing test suite?

That is executed by a github action on PRs, but can also be run locally as described in the contribution guide

from anvil-extras.

meatballs avatar meatballs commented on June 23, 2024

It would be very nice to 'eat our own dog food' and add some UI testing using anvil-test

from anvil-extras.

s-cork avatar s-cork commented on June 23, 2024

it's specifically things for client side low level component functionality which would be easier done having access to both the dom and the anvil components.

I don't think that's as easy with anvil-test alone since it focuses on higher level user experience.

e.g.

def __init__(self):
    self.base = anvil_extras.Tabs
    self.component = anvil_extras.Tabs(tab_titles=["Tab 1", "Tab 2", "Tab 3"])
    self.dom_node = anvil.js.get_dom_node(self.component)

def test_constructor(self):
    tabs = self.base(tab_titles=["foo"])
    self.assertEqual(tabs.tab_titles, ["foo"])
    

def test_tabs_clicked(self):
    with self.assertRaisesEvent('tabs_clicked'):
        self.component.trigger('click')

def test_dynamic_color_prop(self):
    self.component.foreground = "#eee"
    self.assertEqual(self.dom_node.style.getProperty("--fg"), "#eee")
    self.assertEqual(#computed style of tabs is actually #eee)

def test_dynamic_tabs(self):
    with self.assertRaises(TypeError):
        self.component.tabs = 'foo'
    ...

But happy to be convinced otherwise.

from anvil-extras.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.