Closed Bug 1947613 Opened 1 year ago Closed 1 year ago

Create helpers for using Lit to render elements in test code

Categories

(Toolkit :: UI Widgets, task)

task

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: hjones, Assigned: hjones)

References

(Blocks 1 open bug)

Details

(Whiteboard: [recomp])

Attachments

(1 file)

Starting with the tests for moz_lit_element we have been using Lit to render templates in our chrome tests, rather than the usual method of writing all the HTML markup needed for tests and then writing test code inside the <script> tag. We are doing this in all of our input element tests and our tests for MozBoxButton in addition to in those tests for MozLitElement. We have started to see some repeated logic across these tests - for example this code importing lit and creating a function for rendering templates is fairly similar to this code in our InputTestHelpers class. We should move this functionality somewhere common so that we no longer have to reimplement it each time we want to use Lit in a new test.

Assignee: nobody → hjones
Attachment #9465787 - Attachment description: WIP: Bug 1947613 - create helper functions for writing tests using Lit → Bug 1947613 - refactor InputTestHelper functions for generally writing tests using Lit r=#recomp-reviewers
Status: NEW → ASSIGNED
Pushed by hjones@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/247db6ae4912 refactor InputTestHelper functions for generally writing tests using Lit r=reusable-components-reviewers,mstriemer

Backed out for causing mochitest failures @ test_moz_checkbox.html

TEST-UNEXPECTED-FAIL | toolkit/content/tests/widgets/test_moz_checkbox.html | TypeError: this.renderInputElements is not a function - Should not throw any errors
Flags: needinfo?(hjones)
Pushed by hjones@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1a7efcb68798 refactor InputTestHelper functions for generally writing tests using Lit r=reusable-components-reviewers,mstriemer
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
Flags: needinfo?(hjones)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: