{"size": 1229, "ext": "js", "max_stars_repo_path": "tests/e2e/dev_console.js", "max_stars_repo_name": "Dilven/magic-mirror-bob", "max_stars_repo_stars_event_min_datetime": "2015-01-01T22:28:44.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T19:11:30.000Z", "max_issues_repo_path": "tests/e2e/dev_console.js", "max_issues_repo_name": "jakollar/MagicMirror", "max_issues_repo_issues_event_min_datetime": "2015-01-08T21:58:00.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T09:35:46.000Z", "max_forks_repo_path": "tests/e2e/dev_console.js", "max_forks_repo_name": "jakollar/MagicMirror", "max_forks_repo_forks_event_min_datetime": "2015-01-08T21:40:04.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T04:41:21.000Z"}
{"max_stars_count": 17100, "max_issues_count": 2290, "max_forks_count": 5248, "avg_line_length": 22.7592592593, "max_line_length": 73, "alphanum_fraction": 0.6444263629}
const helpers = require("./global-setup");

describe("Development console tests", function () {
	helpers.setupTimeout(this);

	let app = null;

	beforeAll(function () {
		// Set config sample for use in test
		process.env.MM_CONFIG_FILE = "tests/configs/env.js";
	});

	describe("Without 'dev' commandline argument", function () {
		beforeAll(function () {
			return helpers
				.startApplication({
					args: ["js/electron.js"]
				})
				.then(function (startedApp) {
					app = startedApp;
				});
		});

		afterAll(function () {
			return helpers.stopApplication(app);
		});

		it("should not open dev console when absent", async function () {
			await app.client.waitUntilWindowLoaded();
			return expect(await app.browserWindow.isDevToolsOpened()).toBe(false);
		});
	});

	describe("With 'dev' commandline argument", function () {
		beforeAll(function () {
			return helpers
				.startApplication({
					args: ["js/electron.js", "dev"]
				})
				.then(function (startedApp) {
					app = startedApp;
				});
		});

		afterAll(function () {
			return helpers.stopApplication(app);
		});

		it("should open dev console when provided", async function () {
			expect(await app.client.getWindowCount()).toBe(2);
		});
	});
});
