streamlit
1/**
2* Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*/
16
17// Regression test for https://github.com/streamlit/streamlit/issues/3873
18
19describe("checkbox state update regression", () => {20beforeEach(() => {21cy.loadApp("http://localhost:3000/");22});23
24it("checking one disables the other", () => {25cy.get("[data-baseweb='checkbox']").should("have.length", 2);26cy.getIndexed("[type='checkbox']", 0).should(27"have.attr",28"aria-checked",29"true"30);31cy.getIndexed("[type='checkbox']", 1).should(32"have.attr",33"aria-checked",34"false"35);36
37cy.getIndexed("[data-baseweb='checkbox']", 1).click();38cy.getIndexed("[type='checkbox']", 0).should(39"have.attr",40"aria-checked",41"false"42);43cy.getIndexed("[type='checkbox']", 1).should(44"have.attr",45"aria-checked",46"true"47);48});49});50