<commit_before>import Collisions from "../../web/static/js/services/collisions"

describe("Collisions", () => {
  describe("identifyAllIdeaCollisionsSortedByIdAscending", () => {
    it("identifies no collisions in an empty list", () => {
      expect(Collisions.identifyAllIdeaCollisionsSortedByIdAscending([])).to.deep.equal(new Map())
    })

    describe("when two ideas have dimensions that overlap", () => {
      const ideas = [{
        id: 1,
        x: 0,
        y: 0,
        height: 20,
        width: 20,
      }, {
        id: 2,
        x: 10,
        y: 10,
        height: 20,
        width: 20,
      }]<commit_msg>Add regression test for non-colliding ideas in Collisions module<commit_after>import Collisions from "../../web/static/js/services/collisions"

describe("Collisions", () => {
  describe("identifyAllIdeaCollisionsSortedByIdAscending", () => {
    it("identifies no collisions in an empty list", () => {
      expect(Collisions.identifyAllIdeaCollisionsSortedByIdAscending([])).to.deep.equal(new Map())
    })

    describe("when two ideas' dimensions do not overlap", () => {
      const ideas = [{
        id: 1,
        x: 0,
        y: 0,
        height: 20,
        width: 20,
      }, {
        id: 2,
        x: 30,
        y: 30,
        height: 20,
        width: 20,
      }]

      it("does not identify any collisions", () => {
        const result = Collisions.identifyAllIdeaCollisionsSortedByIdAscending(ideas)
        expect(result).to.deep.equal(new Map([]))
      })
    })

    describe("when two ideas have dimensions that overlap", () => {
      const ideas = [{
        id: 1,
        x: 0,
        y: 0,
        height: 20,
        width: 20,
      }, {
        id: 2,
        x: 10,
        y: 10,
        height: 20,
        width: 20,
      }]
{'fraction_non_alphanumeric': 0.14269850083287064, 'fraction_numerical': 0.026651860077734593, 'mean_word_length': 2.038785834738617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '5303331', 'n_tokens_mistral': 613, 'n_tokens_neox': 546, 'n_words': 135}