<commit_before>/* eslint-disable */
import { observe } from "mobx";
import ProjectStore from "../../stores/domain/ProjectStore";
import Suite from "../../models/Suite";
import Test from "../../models/Test";

describe("Suite model", () => {
  it("new suite should be named 'Utitled Suite'", () => {
    expect((new Suite()).name).toBe("Untitled Suite");
  });
  it("should observe name changes", () => {
    const suite = new Suite();
    const disposer = observe(suite, "name", (change) => {
      expect(change.newValue).toBe("changed");
    });
    suite.name = "changed";
    disposer();
  });
  it("Tests should have randomly generated identifiers", () => {
    expect((new Suite()).id).not.toBe((new Suite()).id);
  });
  it("should observe when a new Test is added", () => {
    const suite = new Suite();
    const disposer = observe(suite, "tests", (change) => {
      expect(change.newValue.length).toBe(1);
    });
    suite.tests.push(new Test());
  });
  it("should add a new Test", () => {
    const store = new ProjectStore();
    const suite = new Suite(store);
    const test = new Test();
    store.addTest(test);
    expect(suite.tests.length).toBe(0);
    suite.addTest(test);
    expect(suite.tests.length).toBe(1);
  });
  it("should throw if no Test was given", () => {
    const suite = new Suite();
    expect(() => suite.addTest()).toThrowError("Expected to receive Test instead received undefined");
  });
  it("should throw if a different type was given", () => {
    const suite = new Suite();
    expect(() => suite.addTest(1)).toThrowError("Expected to receive Test instead received Number");
  });
  it("should remove a Test", () => {
    const store = new ProjectStore();
    const suite = new Suite(store);
    const test = new Test();
    store.addTest(test);
    suite.addTest(test);
    expect(suite.tests.length).toBe(1);
    suite.removeTest(test);
    expect(suite.tests.length).toBe(0);
  });
  it("should do nothing if removed a non-existent test", () => {
    const store = new ProjectStore();
    const suite = new Suite(store);
    const test = new Test();
    store.addTest(test)
    suite.addTest(test);
    expect(suite.tests.length).toBe(1);
    suite.removeTest(new Test());
    expect(suite.tests.length).toBe(1);
  });
  it("should throw if a different type was given", () => {
    const suite = new Suite();
    expect(() => suite.removeTest(1)).toThrowError("Expected to receive Test instead received Number");
  });
});
<commit_msg>removed store from suite ctor<commit_after>/* eslint-disable */
import { observe } from "mobx";
import ProjectStore from "../../stores/domain/ProjectStore";
import Suite from "../../models/Suite";
import Test from "../../models/Test";

describe("Suite model", () => {
  it("new suite should be named 'Utitled Suite'", () => {
    expect((new Suite()).name).toBe("Untitled Suite");
  });
  it("should observe name changes", () => {
    const suite = new Suite();
    const disposer = observe(suite, "name", (change) => {
      expect(change.newValue).toBe("changed");
    });
    suite.name = "changed";
    disposer();
  });
  it("Tests should have randomly generated identifiers", () => {
    expect((new Suite()).id).not.toBe((new Suite()).id);
  });
  it("should observe when a new Test is added", () => {
    const suite = new Suite();
    const disposer = observe(suite, "tests", (change) => {
      expect(change.newValue.length).toBe(1);
    });
    suite.tests.push(new Test());
  });
  it("should add a new Test", () => {
    const store = new ProjectStore();
    const suite = new Suite();
    const test = new Test();
    store.addTest(test);
    expect(suite.tests.length).toBe(0);
    suite.addTest(test);
    expect(suite.tests.length).toBe(1);
  });
  it("should throw if no Test was given", () => {
    const suite = new Suite();
    expect(() => suite.addTest()).toThrowError("Expected to receive Test instead received undefined");
  });
  it("should throw if a different type was given", () => {
    const suite = new Suite();
    expect(() => suite.addTest(1)).toThrowError("Expected to receive Test instead received Number");
  });
  it("should remove a Test", () => {
    const store = new ProjectStore();
    const suite = new Suite();
    const test = new Test();
    store.addTest(test);
    suite.addTest(test);
    expect(suite.tests.length).toBe(1);
    suite.removeTest(test);
    expect(suite.tests.length).toBe(0);
  });
  it("should do nothing if removed a non-existent test", () => {
    const store = new ProjectStore();
    const suite = new Suite();
    const test = new Test();
    store.addTest(test)
    suite.addTest(test);
    expect(suite.tests.length).toBe(1);
    suite.removeTest(new Test());
    expect(suite.tests.length).toBe(1);
  });
  it("should throw if a different type was given", () => {
    const suite = new Suite();
    expect(() => suite.removeTest(1)).toThrowError("Expected to receive Test instead received Number");
  });
});

{'fraction_non_alphanumeric': 0.18137944902473357, 'fraction_numerical': 0.0036195455459481197, 'mean_word_length': 3.4134871339840283, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6329205', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1458, 'n_words': 410}