diff --git a/tests/frontend/confirm_controller_test.js b/tests/frontend/confirm_controller_test.js index 3f2b9b294705..15f2195c6f17 100644 --- a/tests/frontend/confirm_controller_test.js +++ b/tests/frontend/confirm_controller_test.js @@ -61,6 +61,15 @@ describe("Confirm controller", () => { }); }); + describe("entering incorrect casing text", function() { + it("enables the button", function() { + fireEvent.input(document.getElementById("input-target"), { target: { value: "PACKAGE" } }); + + const buttonTarget = document.getElementById("button-target"); + expect(buttonTarget).not.toHaveAttribute("disabled"); + }); + }); + describe("entering incorrect text", function() { it("disables the button", function() { fireEvent.input(document.getElementById("input-target"), { target: { value: "foobar" } }); diff --git a/warehouse/static/js/warehouse/controllers/confirm_controller.js b/warehouse/static/js/warehouse/controllers/confirm_controller.js index 9c18c9349f37..e01a38c5c516 100644 --- a/warehouse/static/js/warehouse/controllers/confirm_controller.js +++ b/warehouse/static/js/warehouse/controllers/confirm_controller.js @@ -23,7 +23,7 @@ export default class extends Controller { } check() { - if (this.inputTarget.value == this.buttonTarget.dataset.expected) { + if (this.inputTarget.value.toLowerCase() === this.buttonTarget.dataset.expected.toLowerCase()) { this.buttonTarget.disabled = false; } else { this.buttonTarget.disabled = true;