<commit_before>require 'spec_helper'

describe "map" do

  it "can load mapdata.json without errors" do

    # TODO: use Factorybot to create this lab object
    Lab.create!(
      name: "MyLab",
      kind: 'fab_lab',
      country_code: 'IS',
      address_1: 'MyStreet 24',
      email: '<EMAIL>',
      network: true,
      tools: true,
      programs: true,
      workflow_state: 'approved',
      latitude: 64.963,
      longitude: 19.0208
    )

    visit mapdata_labs_url
    expect(page).to have_http_status(200)
  end

  it "has map page" do
    visit labs_path
    click_link "Map view"
    expect(page).to have_title("Map")
    expect(current_url).to include(map_labs_url)
  end

  skip "shows approved labs", js: true do<commit_msg>Improve comment on mapdata.json error<commit_after>require 'spec_helper'

describe "map" do

  it "can load mapdata.json without errors" do

    # TODO: use Factorybot to create this lab object
    # It does not catch the error if map_serializer is like it was before 5f409af
    # lab = Factorybot.create(:lab)
    # Which resulted in the map to show up empty
    Lab.create!(
      name: "MyLab",
      kind: 'fab_lab',
      country_code: 'IS',
      address_1: 'MyStreet 24',
      email: '<EMAIL>',
      network: true,
      tools: true,
      programs: true,
      workflow_state: 'approved',
      latitude: 64.963,
      longitude: 19.0208
    )

    visit mapdata_labs_url
    expect(page).to have_http_status(200)
  end

  it "has map page" do
    visit labs_path
    click_link "Map view"
    expect(page).to have_title("Map")
    expect(current_url).to include(map_labs_url)
  end

  skip "shows approved labs", js: true do
{'fraction_non_alphanumeric': 0.09815585960737656, 'fraction_numerical': 0.022605591909577633, 'mean_word_length': 2.8054298642533935, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6414036', 'n_tokens_mistral': 602, 'n_tokens_neox': 553, 'n_words': 170}