<commit_before>jest.mock('app/services/Firebase', () => {});
import thunk from 'redux-thunk';
import configureMockStore from 'redux-mock-store';

import * as Analytics from 'app/services/Analytics';
import * as sut from 'app/features/settings/metrics/SettingsMetricsActions';

const middlewares = [ thunk ];
const mockStore = configureMockStore(middlewares);
var logEventSpy = null;
var store = null;

describe('what are metric tips', () => {
    beforeEach(() => {
        logEventSpy = jest.spyOn(Analytics, 'logEventWithAppState').mockImplementation(() => {});        
        store = mockStore({
            collapsedSettings: {}
        });
    });

    afterEach(() => {
        logEventSpy.mockReset();        
    });

    afterAll(() => {
        logEventSpy.mockRestore();
    });   

    test('what are metric tips gets logged', () => {
        store.dispatch(sut.presentBigMetricsInfo());
        
        const event = logEventSpy.mock.calls[0][0];
        const params = logEventSpy.mock.calls[0][1];
        expect(event).toEqual('what_are_metric_tips');
        expect(params).toEqual({});
    });
});

describe('edit collapsed metric screen', () => {
    beforeEach(() => {
        logEventSpy = jest.spyOn(Analytics, 'setCurrentScreen').mockImplementation(() => {});        
        store = mockStore({
            collapsedSettings: {}
        });
    });

    afterEach(() => {
        logEventSpy.mockReset();        
    });

    afterAll(() => {
        logEventSpy.mockRestore();
    });   

    test('edit collapsed_metric screen is set', () => {
        store.dispatch(sut.presentCollapsedMetric());
        
        const event = logEventSpy.mock.calls[0][0];
        expect(event).toEqual('edit_collapsed_metric');
    });    
});

describe('edit quantifier screen', () => {
    beforeEach(() => {
        logEventSpy = jest.spyOn(Analytics, 'setCurrentScreen').mockImplementation(() => {});        
        store = mockStore({
            collapsedSettings: {}
        });
    });

    afterEach(() => {
        logEventSpy.mockReset();        
    });

    afterAll(() => {
        logEventSpy.mockRestore();
    });   

    test('edit quantifier screen is set', () => {
        store.dispatch(sut.presentQuantifier());
        
        const event = logEventSpy.mock.calls[0][0];
        expect(event).toEqual('edit_quantifier');
    });    
});<commit_msg>Tweaked tests with renames<commit_after>jest.mock('app/services/Firebase', () => {});
import thunk from 'redux-thunk';
import configureMockStore from 'redux-mock-store';

import * as Analytics from 'app/services/Analytics';
import * as sut from 'app/features/settings/metrics/SettingsMetricsActions';

const middlewares = [ thunk ];
const mockStore = configureMockStore(middlewares);
var logEventSpy = null;
var logScreenSpy = null;
var store = null;

describe('what are metric tips', () => {
    beforeEach(() => {
        logEventSpy = jest.spyOn(Analytics, 'logEventWithAppState').mockImplementation(() => {});        
        store = mockStore({
            collapsedSettings: {}
        });
    });

    afterEach(() => {
        logEventSpy.mockReset();        
    });

    afterAll(() => {
        logEventSpy.mockRestore();
    });   

    test('what are metric tips gets logged', () => {
        store.dispatch(sut.presentBigMetricsInfo());
        
        const event = logEventSpy.mock.calls[0][0];
        const params = logEventSpy.mock.calls[0][1];
        expect(event).toEqual('what_are_metric_tips');
        expect(params).toEqual({});
    });
});

describe('edit collapsed metric screen', () => {
    beforeEach(() => {
        logScreenSpy = jest.spyOn(Analytics, 'setCurrentScreen').mockImplementation(() => {});        
        store = mockStore({
            collapsedSettings: {}
        });
    });

    afterEach(() => {
        logScreenSpy.mockReset();        
    });

    afterAll(() => {
        logScreenSpy.mockRestore();
    });   

    test('edit collapsed_metric screen is set', () => {
        store.dispatch(sut.presentCollapsedMetric());
        
        const event = logScreenSpy.mock.calls[0][0];
        expect(event).toEqual('edit_collapsed_metric');
    });    
});

describe('edit quantifier screen', () => {
    beforeEach(() => {
        logScreenSpy = jest.spyOn(Analytics, 'setCurrentScreen').mockImplementation(() => {});        
        store = mockStore({
            collapsedSettings: {}
        });
    });

    afterEach(() => {
        logScreenSpy.mockReset();        
    });

    afterAll(() => {
        logScreenSpy.mockRestore();
    });   

    test('edit quantifier screen is set', () => {
        store.dispatch(sut.presentQuantifier());
        
        const event = logScreenSpy.mock.calls[0][0];
        expect(event).toEqual('edit_quantifier');
    });    
});
{'fraction_non_alphanumeric': 0.16341766901700538, 'fraction_numerical': 0.0033181252592285357, 'mean_word_length': 2.5204379562043795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 41, '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': '1445116', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1411, 'n_words': 226}