streamlit

Форк
0
/
session_state_frontend_sync.spec.js 
49 строк · 1.4 Кб
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

19
describe("checkbox state update regression", () => {
20
  beforeEach(() => {
21
    cy.loadApp("http://localhost:3000/");
22
  });
23

24
  it("checking one disables the other", () => {
25
    cy.get("[data-baseweb='checkbox']").should("have.length", 2);
26
    cy.getIndexed("[type='checkbox']", 0).should(
27
      "have.attr",
28
      "aria-checked",
29
      "true"
30
    );
31
    cy.getIndexed("[type='checkbox']", 1).should(
32
      "have.attr",
33
      "aria-checked",
34
      "false"
35
    );
36

37
    cy.getIndexed("[data-baseweb='checkbox']", 1).click();
38
    cy.getIndexed("[type='checkbox']", 0).should(
39
      "have.attr",
40
      "aria-checked",
41
      "false"
42
    );
43
    cy.getIndexed("[type='checkbox']", 1).should(
44
      "have.attr",
45
      "aria-checked",
46
      "true"
47
    );
48
  });
49
});
50

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.