<commit_before>const Endless = imports.gi.Endless;
const EosKnowledge = imports.gi.EosKnowledge;
const Gdk = imports.gi.Gdk;
const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;

EosKnowledge.init();

const TEST_APPLICATION_ID = 'com.endlessm.knowledge.article_presenter';
const TESTDIR = Endless.getCurrentFileDir() + '/..';

const MOCK_ARTICLE_PATH = Endless.getCurrentFileDir() + '/../test-content/cyprus.jsonld';

const TestApplication = new Lang.Class ({
    Name: 'TestApplication',
    Extends: Endless.Application,

    vfunc_startup: function() {

        this.parent();
        let provider = new Gtk.CssProvider();
        let css_file = Gio.File.new_for_uri('resource:///com/endlessm/knowledge/endless_knowledge.css');
        provider.load_from_file(css_file);
        Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
                                                 provider,
                                                 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

        let file = Gio.file_new_for_path(MOCK_ARTICLE_PATH);
        let [success, data] = file.load_contents(null);
        let mockArticleData = JSON.parse(data);

        let articleObject = new EosKnowledge.ArticleObjectModel.new_from_json_ld(mockArticleData);

        let view = new EosKnowledge.ArticlePageA()
        let window = new Endless.Window({
            application: this
        });
        window.get_page_manager().add(view);

        let engine = new EosKnowledge.Engine();

        let presenter = new EosKnowledge.ArticlePresenter({
            article_view: view,
            engine: engine
        });
        presenter.load_article_from_model(articleObject);
        window.show_all();

    }
});
<commit_msg>Fixed smoke test for ArticlePresenter<commit_after>const Endless = imports.gi.Endless;
const EosKnowledge = imports.gi.EosKnowledge;
const Gdk = imports.gi.Gdk;
const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;

EosKnowledge.init();

const TEST_APPLICATION_ID = 'com.endlessm.knowledge.article_presenter';
const TESTDIR = Endless.getCurrentFileDir() + '/..';

const MOCK_ARTICLE_PATH = Endless.getCurrentFileDir() + '/../test-content/cyprus.jsonld';

const TestApplication = new Lang.Class ({
    Name: 'TestApplication',
    Extends: Endless.Application,

    vfunc_startup: function() {

        this.parent();
        let provider = new Gtk.CssProvider();
        let css_file = Gio.File.new_for_uri('resource:///com/endlessm/knowledge/endless_knowledge.css');
        provider.load_from_file(css_file);
        Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
                                                 provider,
                                                 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

        let file = Gio.file_new_for_path(MOCK_ARTICLE_PATH);
        let [success, data] = file.load_contents(null);
        let mockArticleData = JSON.parse(data);

        let articleObject = new EosKnowledge.ArticleObjectModel.new_from_json_ld(mockArticleData);

        let view = new EosKnowledge.ArticlePageA()
        let window = new Endless.Window({
            application: this
        });
        window.get_page_manager().add(view);

        let engine = new EosKnowledge.Engine();

        let presenter = new EosKnowledge.ArticlePresenter({
            article_view: view,
            engine: engine
        });
        presenter.article_model = articleObject;
        window.show_all();

    }
});

{'fraction_non_alphanumeric': 0.10634696755994358, 'fraction_numerical': 0.0, 'mean_word_length': 2.6369230769230767, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5620728', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1048, 'n_words': 185}