Skip to content

Commit

Permalink
Add test coverage for vbml.Component
Browse files Browse the repository at this point in the history
  • Loading branch information
jparise committed Feb 4, 2024
1 parent 3ead68f commit 30f4ebc
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/test_vbml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from vesta.vbml import Component


class TestComponent:
def test_template(self):
assert Component("template").asdict() == {"template": "template"}

def test_style(self):
assert Component("template", style={}).asdict() == {"template": "template"}
assert Component(
"template",
style={"height": 4, "width": 10, "justify": "left", "align": "top"},
).asdict() == {
"template": "template",
"style": {"height": 4, "width": 10, "justify": "left", "align": "top"},
}

def test_height(self):
assert Component("template", height=4).asdict() == {
"template": "template",
"style": {"height": 4},
}

def test_width(self):
assert Component("template", width=10).asdict() == {
"template": "template",
"style": {"width": 10},
}

def test_justify(self):
assert Component("template", justify="left").asdict() == {
"template": "template",
"style": {"justify": "left"},
}

def test_align(self):
assert Component("template", align="top").asdict() == {
"template": "template",
"style": {"align": "top"},
}

0 comments on commit 30f4ebc

Please sign in to comment.