<commit_before>HtmlSignificantOther = require '../lib/html-significant-other'

# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.

describe "your significant other", ->
  describe "on start-up, your significant other", ->

    it "subscribes to the editor"#, ->
      # expect(atom.packages.getActivePackage('html-significant-other')).not.toExist()
      # needs to then spy on the subscription method and activate the atom package
      # expect that we ran the subscription method
      # expect that its subscriptions include a subscription to the text buffer

    it "can tell when you've typed something"
    it "can tell when you've typed a closing angle bracket"

  describe "when a closing angle bracket is typed, your significant other", ->
    # Should work for handlebars, moustache, jade, etc.
    it "determines whether you're working in an HTML(ish) file"
    it "determines whether it was typed in a common templating engine's template"
    it "determines whether it was typed within a (java)script tag"

    # This test should pass if:
    #    - we're in an HTMLish file,
    #    - we're not in a template,
    #    - we're not in a script tag
    it "understands whether you're working in an environment in which you can be helped"
    it "can confirm that you just opened a tag"
    it "can tell what the tag you just opened is"
    it "knows how the tag you just opened closes"


  # sorry this one is grim but I couldn't do enough with the metaphor
  # anywhere else so this is what you get
  describe "when breaking up with your significant other, s/he", ->
    it "properly destroys all the evidence"

  # [workspaceElement, activationPromise] = []
  #
  # beforeEach ->
  #   workspaceElement = atom.views.getView(atom.workspace)
  #   activationPromise = atom.packages.activatePackage('html-significant-other')

  # describe "when the html-significant-other:toggle event is triggered", ->
  #   it "hides and shows the modal panel", ->
  #     # Before the activation event the view is not on the DOM, and no panel
  #     # has been created
  #     expect(workspaceElement.querySelector('.html-significant-other')).not.toExist()
  #
  #     # This is an activation event, triggering it will cause the package to be
  #     # activated.
  #     atom.commands.dispatch workspaceElement, 'html-significant-other:toggle'
  #
  #     waitsForPromise ->
  #       activationPromise
  #
  #     runs ->
  #       expect(workspaceElement.querySelector('.html-significant-other')).toExist()
  #
  #       htmlSignificantOtherElement = workspaceElement.querySelector('.html-significant-other')
  #       expect(htmlSignificantOtherElement).toExist()
  #
  #       htmlSignificantOtherPanel = atom.workspace.panelForItem(htmlSignificantOtherElement)
  #       expect(htmlSignificantOtherPanel.isVisible()).toBe true
  #       atom.commands.dispatch workspaceElement, 'html-significant-other:toggle'
  #       expect(htmlSignificantOtherPanel.isVisible()).toBe false
  #
  #   it "hides and shows the view", ->
  #     # This test shows you an integration test testing at the view level.
  #
  #     # Attaching the workspaceElement to the DOM is required to allow the
  #     # `toBeVisible()` matchers to work. Anything testing visibility or focus
  #     # requires that the workspaceElement is on the DOM. Tests that attach the
  #     # workspaceElement to the DOM are generally slower than those off DOM.
  #     jasmine.attachToDOM(workspaceElement)
  #
  #     expect(workspaceElement.querySelector('.html-significant-other')).not.toExist()
  #
  #     # This is an activation event, triggering it causes the package to be
  #     # activated.
  #     atom.commands.dispatch workspaceElement, 'html-significant-other:toggle'
  #
  #     waitsForPromise ->
  #       activationPromise
  #
  #     runs ->
  #       # Now we can test for view visibility
  #       htmlSignificantOtherElement = workspaceElement.querySelector('.html-significant-other')
  #       expect(htmlSignificantOtherElement).toBeVisible()
  #       atom.commands.dispatch workspaceElement, 'html-significant-other:toggle'
  #       expect(htmlSignificantOtherElement).not.toBeVisible()
<commit_msg>How does one write tests for this...?<commit_after>HtmlSignificantOther = require '../lib/html-significant-other'

# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.

describe "your significant other", ->
  describe "on start-up, your significant other", ->

    instance = atom.packages.getLoadedPackage('html-significant-other')

    it "subscribes to the editor", ->
      expect(atom.packages.getActivePackage('html-significant-other')).not.toExist()
      # needs to then spy on the subscription method and activate the atom package
      # expect that we ran the subscription method
      # expect that its subscriptions include a subscription to the text buffer

    atom.packages.activatePackage('html-significant-other')

    it "can tell when you've typed something"
    it "can tell when you've typed a closing angle bracket"

  describe "when a closing angle bracket is typed, your significant other", ->
    # Should work for handlebars, moustache, jade, etc.
    it "determines whether you're working in an HTML(ish) file"
    it "determines whether it was typed in a common templating engine's template"
    it "determines whether it was typed within a (java)script tag"

    # This test should pass if:
    #    - we're in an HTMLish file,
    #    - we're not in a template,
    #    - we're not in a script tag
    it "understands whether you're working in an environment in which you can be helped"
    it "can confirm that you just opened a tag"
    it "can tell what the tag you just opened is"
    it "knows how the tag you just opened closes"


  # sorry this one is grim but I couldn't do enough with the metaphor
  # anywhere else so this is what you get
  describe "when breaking up with your significant other, s/he", ->
    it "properly destroys all the evidence"

  # [workspaceElement, activationPromise] = []
  #
  # beforeEach ->
  #   workspaceElement = atom.views.getView(atom.workspace)
  #   activationPromise = atom.packages.activatePackage('html-significant-other')

  # describe "when the html-significant-other:toggle event is triggered", ->
  #   it "hides and shows the modal panel", ->
  #     # Before the activation event the view is not on the DOM, and no panel
  #     # has been created
  #     expect(workspaceElement.querySelector('.html-significant-other')).not.toExist()
  #
  #     # This is an activation event, triggering it will cause the package to be
  #     # activated.
  #     atom.commands.dispatch workspaceElement, 'html-significant-other:toggle'
  #
  #     waitsForPromise ->
  #       activationPromise
  #
  #     runs ->
  #       expect(workspaceElement.querySelector('.html-significant-other')).toExist()
  #
  #       htmlSignificantOtherElement = workspaceElement.querySelector('.html-significant-other')
  #       expect(htmlSignificantOtherElement).toExist()
  #
  #       htmlSignificantOtherPanel = atom.workspace.panelForItem(htmlSignificantOtherElement)
  #       expect(htmlSignificantOtherPanel.isVisible()).toBe true
  #       atom.commands.dispatch workspaceElement, 'html-significant-other:toggle'
  #       expect(htmlSignificantOtherPanel.isVisible()).toBe false
  #
  #   it "hides and shows the view", ->
  #     # This test shows you an integration test testing at the view level.
  #
  #     # Attaching the workspaceElement to the DOM is required to allow the
  #     # `toBeVisible()` matchers to work. Anything testing visibility or focus
  #     # requires that the workspaceElement is on the DOM. Tests that attach the
  #     # workspaceElement to the DOM are generally slower than those off DOM.
  #     jasmine.attachToDOM(workspaceElement)
  #
  #     expect(workspaceElement.querySelector('.html-significant-other')).not.toExist()
  #
  #     # This is an activation event, triggering it causes the package to be
  #     # activated.
  #     atom.commands.dispatch workspaceElement, 'html-significant-other:toggle'
  #
  #     waitsForPromise ->
  #       activationPromise
  #
  #     runs ->
  #       # Now we can test for view visibility
  #       htmlSignificantOtherElement = workspaceElement.querySelector('.html-significant-other')
  #       expect(htmlSignificantOtherElement).toBeVisible()
  #       atom.commands.dispatch workspaceElement, 'html-significant-other:toggle'
  #       expect(htmlSignificantOtherElement).not.toBeVisible()

{'fraction_non_alphanumeric': 0.09191383782564565, 'fraction_numerical': 0.0, 'mean_word_length': 3.2696196437168994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, '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': '7473170', 'n_tokens_mistral': 2531, 'n_tokens_neox': 2407, 'n_words': 841}