<commit_before>// Copyright 2016 Endless Mobile, Inc.

/* exported test_arrangement_compliance, test_arrangement_fade_in_compliance,
test_card_compliance, test_card_container_fade_in_compliance */

const {DModel, Gtk} = imports.gi;
const Lang = imports.lang;

const CssClassMatcher = imports.tests.CssClassMatcher;
const HistoryStore = imports.app.historyStore;
const Minimal = imports.tests.minimal;
const MockDispatcher = imports.tests.mockDispatcher;
const MockEngine = imports.tests.mockEngine;
const MockFactory = imports.tests.mockFactory;
const MockReadingHistoryModel = imports.tests.mockReadingHistoryModel;
const WidgetDescendantMatcher = imports.tests.WidgetDescendantMatcher;
const Utils = imports.tests.utils;

function test_card_compliance(CardClass, setup=function () {}) {
    describe(CardClass.$gtype.name + ' implements Card correctly', function () {
        beforeEach(function () {
            jasmine.addMatchers(CssClassMatcher.customMatchers);
        });

        it('by having a theming class for PDF records', function () {
            let card = new CardClass({
                model: new DModel.Content({
                    title: 'The Joy Of Cooking, Pirated Copy',
                    content_type: 'application/pdf',
                }),
            });
            let pretty_name = CardClass.$gtype.name.slice('Ekn'.length)
                .replace(/_/, '', 'g');
            expect(card).toHaveCssClass('Card--pdf');
            expect(card).toHaveCssClass(pretty_name + '--pdf');
            card = new CardClass({
                model: new DModel.Content({
                    title: 'Autoconf Manual',<commit_msg>tests/compliance.js: register resource before importing HistoryStore<commit_after>// Copyright 2016 Endless Mobile, Inc.

/* exported test_arrangement_compliance, test_arrangement_fade_in_compliance,
test_card_compliance, test_card_container_fade_in_compliance */

const {DModel, Gtk} = imports.gi;
const Lang = imports.lang;

const Utils = imports.tests.utils;
Utils.register_gresource();

const CssClassMatcher = imports.tests.CssClassMatcher;
const HistoryStore = imports.app.historyStore;
const Minimal = imports.tests.minimal;
const MockDispatcher = imports.tests.mockDispatcher;
const MockEngine = imports.tests.mockEngine;
const MockFactory = imports.tests.mockFactory;
const MockReadingHistoryModel = imports.tests.mockReadingHistoryModel;
const WidgetDescendantMatcher = imports.tests.WidgetDescendantMatcher;

function test_card_compliance(CardClass, setup=function () {}) {
    describe(CardClass.$gtype.name + ' implements Card correctly', function () {
        beforeEach(function () {
            jasmine.addMatchers(CssClassMatcher.customMatchers);
        });

        it('by having a theming class for PDF records', function () {
            let card = new CardClass({
                model: new DModel.Content({
                    title: 'The Joy Of Cooking, Pirated Copy',
                    content_type: 'application/pdf',
                }),
            });
            let pretty_name = CardClass.$gtype.name.slice('Ekn'.length)
                .replace(/_/, '', 'g');
            expect(card).toHaveCssClass('Card--pdf');
            expect(card).toHaveCssClass(pretty_name + '--pdf');
            card = new CardClass({
                model: new DModel.Content({
                    title: 'Autoconf Manual',
{'fraction_non_alphanumeric': 0.10537190082644628, 'fraction_numerical': 0.0023612750885478157, 'mean_word_length': 3.0393325387365913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6570630', 'n_tokens_mistral': 958, 'n_tokens_neox': 892, 'n_words': 199}