-
Notifications
You must be signed in to change notification settings - Fork 23
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal Test suite #74
Comments
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 |
It would be very nice to 'eat our own dog food' and add some UI testing using anvil-test |
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. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
We should have a separate test suite that depends on anvil-extras
Especially if the user who depend on it grow.
And after #73 we're committing to backward compatibility/being very loud about breaking changes - until anvil supports versioning.
Happy to get this one started since I have a template written for testing anvil components internally.
I'm not sure what the best integration is here.
It shouldn't be part of the anvil-extras client_code since that'll massively bulk up what gets sent to the client for those depending on the app.
We also would want prs to include tests.
It might be least hassle to create a test suite app as a separate repo and make a note of how to add tests with a pr in the contributing docs.
The text was updated successfully, but these errors were encountered: