Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 86d1870

Browse files
committed
Merge pull request #6731 from WebsiteDeveloper/fixCodeInspectionTests
Fix CodeInspection Integration tests for non english locales
2 parents 004f0c9 + 357a549 commit 86d1870

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

test/spec/CodeInspection-test.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ define(function (require, exports, module) {
2828
"use strict";
2929

3030
var SpecRunnerUtils = require("spec/SpecRunnerUtils"),
31-
FileSystem = require("filesystem/FileSystem");
31+
FileSystem = require("filesystem/FileSystem"),
32+
StringUtils = require("utils/StringUtils"),
33+
Strings;
3234

3335
describe("Code Inspection", function () {
3436
this.category = "integration";
@@ -83,6 +85,7 @@ define(function (require, exports, module) {
8385
// Load module instances from brackets.test
8486
$ = testWindow.$;
8587
brackets = testWindow.brackets;
88+
Strings = testWindow.require("strings");
8689
CommandManager = brackets.test.CommandManager;
8790
EditorManager = brackets.test.EditorManager;
8891
CodeInspection = brackets.test.CodeInspection;
@@ -393,13 +396,13 @@ define(function (require, exports, module) {
393396

394397
runs(function () {
395398
var $problemPanelTitle = $("#problems-panel .title").text();
396-
expect($problemPanelTitle).toBe("1 JavaScript Linter Problem");
399+
expect($problemPanelTitle).toBe(StringUtils.format(Strings.SINGLE_ERROR, "JavaScript Linter"));
397400

398401
var $statusBar = $("#status-inspection");
399402
expect($statusBar.is(":visible")).toBe(true);
400403

401404
var tooltip = $statusBar.attr("title");
402-
expect(tooltip).toBe("1 JavaScript Linter Problem");
405+
expect(tooltip).toBe(StringUtils.format(Strings.SINGLE_ERROR, "JavaScript Linter"));
403406
});
404407
});
405408

@@ -426,13 +429,13 @@ define(function (require, exports, module) {
426429

427430
runs(function () {
428431
var $problemPanelTitle = $("#problems-panel .title").text();
429-
expect($problemPanelTitle).toBe("2 JavaScript Linter Problems");
432+
expect($problemPanelTitle).toBe(StringUtils.format(Strings.MULTIPLE_ERRORS, "JavaScript Linter", 2));
430433

431434
var $statusBar = $("#status-inspection");
432435
expect($statusBar.is(":visible")).toBe(true);
433436

434437
var tooltip = $statusBar.attr("title");
435-
expect(tooltip).toBe("2 JavaScript Linter Problems");
438+
expect(tooltip).toBe(StringUtils.format(Strings.MULTIPLE_ERRORS, "JavaScript Linter", 2));
436439
});
437440
});
438441

@@ -448,14 +451,14 @@ define(function (require, exports, module) {
448451

449452
runs(function () {
450453
var $problemPanelTitle = $("#problems-panel .title").text();
451-
expect($problemPanelTitle).toBe("2 Problems");
454+
expect($problemPanelTitle).toBe(StringUtils.format(Strings.ERRORS_PANEL_TITLE_MULTIPLE, 2));
452455

453456
var $statusBar = $("#status-inspection");
454457
expect($statusBar.is(":visible")).toBe(true);
455458

456459
var tooltip = $statusBar.attr("title");
457460
// tooltip will contain + in the title if the inspection was aborted
458-
expect(tooltip).toBe("2 Problems");
461+
expect(tooltip).toBe(StringUtils.format(Strings.ERRORS_PANEL_TITLE_MULTIPLE, 2));
459462
});
460463
});
461464

@@ -472,7 +475,7 @@ define(function (require, exports, module) {
472475
expect($statusBar.is(":visible")).toBe(true);
473476

474477
var tooltip = $statusBar.attr("title");
475-
expect(tooltip).toBe("No problems found - good job!");
478+
expect(tooltip).toBe(Strings.NO_ERRORS_MULTIPLE_PROVIDER);
476479
});
477480
});
478481

@@ -487,7 +490,7 @@ define(function (require, exports, module) {
487490
expect($statusBar.is(":visible")).toBe(true);
488491

489492
var tooltip = $statusBar.attr("title");
490-
expect(tooltip).toBe("No JavaScript Linter1 problems found - good job!");
493+
expect(tooltip).toBe(StringUtils.format(Strings.NO_ERRORS, "JavaScript Linter1"));
491494
});
492495
});
493496

@@ -563,13 +566,13 @@ define(function (require, exports, module) {
563566

564567
runs(function () {
565568
var $problemPanelTitle = $("#problems-panel .title").text();
566-
expect($problemPanelTitle).toBe("2 Problems");
569+
expect($problemPanelTitle).toBe(StringUtils.format(Strings.ERRORS_PANEL_TITLE_MULTIPLE, 2));
567570

568571
var $statusBar = $("#status-inspection");
569572
expect($statusBar.is(":visible")).toBe(true);
570573

571574
var tooltip = $statusBar.attr("title");
572-
expect(tooltip).toBe("2 Problems");
575+
expect(tooltip).toBe(StringUtils.format(Strings.ERRORS_PANEL_TITLE_MULTIPLE, 2));
573576
});
574577
});
575578
});

0 commit comments

Comments
 (0)