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
import { LabelStudio } from "@humansignal/frontend-test/helpers/LSF";
import { allLabelsEmptyConfig, allLabelsEmptyData, resultWithNotExistedLabels } from "../../data/config/empty-labels";
 
describe("Empty labels", () => {
  it("Should retain labels that are not explicitly defined in the configuration", () => {
    LabelStudio.params()
      .config(allLabelsEmptyConfig)
      .data(allLabelsEmptyData)
      .withResult(resultWithNotExistedLabels)
      .init();
 
    LabelStudio.waitForObjectsReady();
 
    LabelStudio.serialize().then((results) => {
      const length = results.length;
      expect(length).to.equal(resultWithNotExistedLabels.length);
 
      for (let i = 0; i < length; i++) {
        const result = results[i];
        const type = result.type;
        expect(result.value[type]).to.deep.equal(resultWithNotExistedLabels[i].value[type]);
      }
    });
  });
});