empty-labels.cy.ts 889 B

12345678910111213141516171819202122232425
  1. import { LabelStudio } from "@humansignal/frontend-test/helpers/LSF";
  2. import { allLabelsEmptyConfig, allLabelsEmptyData, resultWithNotExistedLabels } from "../../data/config/empty-labels";
  3. describe("Empty labels", () => {
  4. it("Should retain labels that are not explicitly defined in the configuration", () => {
  5. LabelStudio.params()
  6. .config(allLabelsEmptyConfig)
  7. .data(allLabelsEmptyData)
  8. .withResult(resultWithNotExistedLabels)
  9. .init();
  10. LabelStudio.waitForObjectsReady();
  11. LabelStudio.serialize().then((results) => {
  12. const length = results.length;
  13. expect(length).to.equal(resultWithNotExistedLabels.length);
  14. for (let i = 0; i < length; i++) {
  15. const result = results[i];
  16. const type = result.type;
  17. expect(result.value[type]).to.deep.equal(resultWithNotExistedLabels[i].value[type]);
  18. }
  19. });
  20. });
  21. });