3
0
Fork 0

fix: add render_vue_finalize() methods for grids, forms

to make the templates just that much cleaner
This commit is contained in:
Lance Edgar 2024-08-19 13:40:23 -05:00
parent 784f974c0d
commit f7e371d21d
7 changed files with 71 additions and 16 deletions

View file

@ -405,6 +405,12 @@ class TestForm(TestCase):
self.assertIn('<script type="text/x-template" id="wutta-form-template">', html)
self.assertNotIn('@submit', html)
def test_render_vue_finalize(self):
form = self.make_form()
html = form.render_vue_finalize()
self.assertIn('<script>', html)
self.assertIn("Vue.component('wutta-form', WuttaForm)", html)
def test_render_vue_field(self):
self.pyramid_config.include('pyramid_deform')
schema = self.make_schema()

View file

@ -855,6 +855,12 @@ class TestGrid(WebTestCase):
html = grid.render_vue_template()
self.assertIn('<script type="text/x-template" id="wutta-grid-template">', html)
def test_render_vue_finalize(self):
grid = self.make_grid()
html = grid.render_vue_finalize()
self.assertIn('<script>', html)
self.assertIn("Vue.component('wutta-grid', WuttaGrid)", html)
def test_get_vue_columns(self):
# error if no columns are set