<commit_before>import _ from 'underscore';
import { compareQuickInfoCountsVsBarPlotCounts } from './../support/macros';


describe('Browse Views - Redirection & Visualization', function () {

    context('Test /browse/ page redirection', function(){

        it('If start from home page, clicking on Browse nav menu item gets us to Browse page.', function(){

            cy.visit('/');

            cy.get('#sBrowse').click().then(()=>{
                cy.get('#page-title-container .page-title span.title').should('have.text', 'Data Browser');
            });

        });

        it('Only shows award.project=4DN results & "Include External Data" is off', function(){

            cy.location('search').should('include', 'award.project=4DN');
            cy.get('#stats .browse-base-state-toggle-container input[type="checkbox"]').should('not.be.checked');

        });


        it('If point browser to /browse/ page (no URL params), we also get redirected to award.project=4DN correctly.', function(){

            cy.visit('/');
            cy.visit('/browse/', { "failOnStatusCode" : false });

            cy.location('search').should('include', 'award.project=4DN');

        });

        it('There is at least 100 ExpSets in default browse view.', function(){
            cy.getQuickInfoBarCounts().its('experiment_sets').should('be.greaterThan', 99);
        });

        it('"/browse/?q=public_release:[* TO 2017-10-31]" redirects to correct URL, includes 40 < x < 50 results.', function(){
            cy.visit('/browse/?q=public_release:[* TO 2017-10-31]').end()
                .location('search').should('include', 'award.project=4DN').should('include', 'q=public_release').should('include', '2017-10-31').end()
                .get('input[name="q"]').should('have.value', 'public_release:[* TO 2017-10-31]')
                .get('.bar-plot-chart .chart-bar').should('have.length.above', 0).end()
                .getQuickInfoBarCounts().its('experiment_sets').should('be.greaterThan', 40).should('be.lessThan', 50);
        });

    });

    context.only('BarPlotChart & QuickInfoBar - filtering using visualization elements', function(){

        before(()=>{
            cy.visit('/browse/', { "failOnStatusCode" : false }) // Wait for redirects
                .wait(300).get('#slow-load-container').should('not.have.class', 'visible').wait(300).end();
        });
<commit_msg>Enable (more) Cypress tests (typo in prev commit)<commit_after>import _ from 'underscore';
import { compareQuickInfoCountsVsBarPlotCounts } from './../support/macros';


describe('Browse Views - Redirection & Visualization', function () {

    context('Test /browse/ page redirection', function(){

        it('If start from home page, clicking on Browse nav menu item gets us to Browse page.', function(){

            cy.visit('/');

            cy.get('#sBrowse').click().then(()=>{
                cy.get('#page-title-container .page-title span.title').should('have.text', 'Data Browser');
            });

        });

        it('Only shows award.project=4DN results & "Include External Data" is off', function(){

            cy.location('search').should('include', 'award.project=4DN');
            cy.get('#stats .browse-base-state-toggle-container input[type="checkbox"]').should('not.be.checked');

        });


        it('If point browser to /browse/ page (no URL params), we also get redirected to award.project=4DN correctly.', function(){

            cy.visit('/');
            cy.visit('/browse/', { "failOnStatusCode" : false });

            cy.location('search').should('include', 'award.project=4DN');

        });

        it('There is at least 100 ExpSets in default browse view.', function(){
            cy.getQuickInfoBarCounts().its('experiment_sets').should('be.greaterThan', 99);
        });

        it('"/browse/?q=public_release:[* TO 2017-10-31]" redirects to correct URL, includes 40 < x < 50 results.', function(){
            cy.visit('/browse/?q=public_release:[* TO 2017-10-31]').end()
                .location('search').should('include', 'award.project=4DN').should('include', 'q=public_release').should('include', '2017-10-31').end()
                .get('input[name="q"]').should('have.value', 'public_release:[* TO 2017-10-31]')
                .get('.bar-plot-chart .chart-bar').should('have.length.above', 0).end()
                .getQuickInfoBarCounts().its('experiment_sets').should('be.greaterThan', 40).should('be.lessThan', 50);
        });

    });

    context('BarPlotChart & QuickInfoBar - filtering using visualization elements', function(){

        before(()=>{
            cy.visit('/browse/', { "failOnStatusCode" : false }) // Wait for redirects
                .wait(300).get('#slow-load-container').should('not.have.class', 'visible').wait(300).end();
        });

{'fraction_non_alphanumeric': 0.1854153718665838, 'fraction_numerical': 0.023617153511497825, 'mean_word_length': 2.8105761641673244, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7662052', 'n_tokens_mistral': 1528, 'n_tokens_neox': 1340, 'n_words': 283}