Esempio n. 1
0
    it('should set the count of entries', function() {
        hist.logHistory(pageConfig);
        expect(hist.test.getHistory()[0][1]).toEqual(1);

        hist.logHistory(pageConfig);
        expect(hist.test.getHistory()[0][1]).toEqual(2);
    });
Esempio n. 2
0
    it('should be able to check a page revisit', function() {
        hist.logHistory(pageConfig);
        expect(hist.isRevisit(pageConfig.pageId)).toBeFalsy();

        hist.logHistory(pageConfig);
        expect(hist.isRevisit(pageConfig.pageId)).toBeTruthy();
    });
Esempio n. 3
0
const updateHistory = (): void => {
    if (config.page.contentType !== 'Network Front') {
        logSummary(config.page);
    }

    logHistory(config.page);
};
Esempio n. 4
0
    it('should only store 50 latest entries', function() {
        storage.local.set('gu.history', max);
        hist.logHistory(pageConfig);

        expect(hist.test.getHistory().length).toEqual(50);
    });
Esempio n. 5
0
    it('should set history to local storage', function() {
        hist.logHistory(pageConfig);

        expect(hist.test.getHistory()[0][0]).toEqual(pageConfig.pageId);
    });