Bin
2025-12-16 9e0b2ba2c317b1a86212f24cbae3195ad1f3dbfa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { Choices, LabelStudio, Tooltip } from "@humansignal/frontend-test/helpers/LSF";
import {
  choicesConfig,
  choicesMultipleSelectionConfig,
  choicesSelectLayoutConfig,
  simpleData,
} from "../../data/control_tags/choice";
import { FF_DEV_2007 } from "@humansignal/frontend-test/feature-flags";
 
describe("Control Tags - Choice", () => {
  describe("Old version", () => {
    beforeEach(() => {
      LabelStudio.addFeatureFlagsOnPageLoad({
        [FF_DEV_2007]: false,
      });
    });
 
    it('should show hint for <Choice /> when choice="single"', () => {
      LabelStudio.params().config(choicesConfig).data(simpleData).withResult([]).init();
 
      Choices.findChoice("Choice 2").trigger("mouseover");
      Tooltip.hasText("A hint for Choice 2");
    });
    it('should show hint for <Choice /> when choice="multiple"', () => {
      LabelStudio.params().config(choicesMultipleSelectionConfig).data(simpleData).withResult([]).init();
 
      Choices.findChoice("Choice 2").trigger("mouseover");
      Tooltip.hasText("A hint for Choice 2");
    });
    it('should show hint for <Choice /> when layout="select"', () => {
      LabelStudio.params().config(choicesSelectLayoutConfig).data(simpleData).withResult([]).init();
 
      Choices.toggleSelect();
      Choices.findOption("Choice 2").trigger("mouseover", { force: true });
      Tooltip.hasText("A hint for Choice 2");
    });
  });
 
  describe("New version", () => {
    beforeEach(() => {
      LabelStudio.addFeatureFlagsOnPageLoad({
        [FF_DEV_2007]: true,
      });
    });
 
    it("should show hint for <Choise />", () => {
      LabelStudio.params().config(choicesConfig).data(simpleData).withResult([]).init();
 
      Choices.findChoice("Choice 2").trigger("mouseover");
      Tooltip.hasText("A hint for Choice 2");
    });
 
    it("should show hint for <Choise />", () => {
      LabelStudio.params().config(choicesMultipleSelectionConfig).data(simpleData).withResult([]).init();
 
      Choices.findChoice("Choice 2").trigger("mouseover");
      Tooltip.hasText("A hint for Choice 2");
    });
  });
});