<commit_before># frozen_string_literal: true
describe 'main process', type: :feature, js: true do
  before do
    create_s3_content(
      bucket: 'my-bucket1.com',
      key: 'my-folder1/my-folder2/my-file1'
    )
  end

  it 'click bucket, folder, back-link' do
    visit '/buckets'

    within('table') do
      click_on 'my-bucket1.com'
    end

    click_on 'my-folder1'

    click_on 'my-folder2'

    expect(page).to have_content 'my-file1'

    click_on 'my-folder1'

    expect(current_path).to eq('/buckets/my-bucket1.com/prefix/my-folder1%2F')

    click_on 'S3 Explorer'

    sleep 0.5

    expect(current_path).to eq('/buckets')
  end
end
<commit_msg>Add feature test<commit_after># frozen_string_literal: true
describe 'main process', type: :feature, js: true do
  before do
    create_s3_content(
      bucket: 'my-bucket1.com',
      key: 'my-folder1/my-folder2/my-file1'
    )
  end

  it 'click bucket, folder, back-link' do
    visit '/buckets'

    within('table') do
      click_on 'my-bucket1.com'
    end

    click_on 'my-folder1'

    click_on 'my-folder2'

    expect(page).to have_content 'my-file1'

    expect(page).not_to have_content 'Pre-Signed'

    find("button.btn.btn-default.btn-xs").click

    sleep 0.1

    expect(page).to have_content 'Pre-Signed URL'

    click_on 'Fetch'

    sleep 0.1

    fetched_url = find('input.url').value
    expect(fetched_url).to be_start_with('http://127.0.0.1')
    expect(URI(fetched_url).path).to eq('/my-bucket1.com/my-folder1/my-folder2/my-file1')

    click_on 'Close'

    click_on 'my-folder1'

    expect(current_path).to eq('/buckets/my-bucket1.com/prefix/my-folder1%2F')

    click_on 'S3 Explorer'

    sleep 0.5

    expect(current_path).to eq('/buckets')
  end
end

{'fraction_non_alphanumeric': 0.13542857142857143, 'fraction_numerical': 0.026285714285714287, 'mean_word_length': 2.9705215419501134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '3681604', 'n_tokens_mistral': 691, 'n_tokens_neox': 644, 'n_words': 128}