mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-04 02:31:33 +00:00
Refactor: remove dead code
I was mistakenly thinking that you can define variables in beforeEach, but it turns out these are not used. Rather, Jest was automatically creating variables for the elements according to their IDs. How convenient!
This commit is contained in:
@@ -18,9 +18,6 @@ describe("ToggleControlController", () => {
|
||||
<input id="checkbox" type="checkbox" value="1" data-action="change->toggle-control#disableIfPresent" />
|
||||
<input id="control" data-toggle-control-target="control">
|
||||
</div>`;
|
||||
|
||||
const checkbox = document.getElementById("checkbox");
|
||||
const control = document.getElementById("control");
|
||||
});
|
||||
|
||||
it("Disables when checkbox is checked", () => {
|
||||
@@ -44,9 +41,6 @@ describe("ToggleControlController", () => {
|
||||
<input id="input" value="" data-action="input->toggle-control#disableIfPresent" />
|
||||
<input id="control" data-toggle-control-target="control">
|
||||
</div>`;
|
||||
|
||||
const input = document.getElementById("input");
|
||||
const control = document.getElementById("control");
|
||||
});
|
||||
|
||||
it("Disables when input is filled", () => {
|
||||
|
||||
Reference in New Issue
Block a user