From dae07ad0505c889d114a40699427cf693c73bf20 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 9 Nov 2016 21:23:30 +0200 Subject: [PATCH] test: fix failing ImageSelectionController tests (#856) This was a small issue affected due to the change in order of the supported extensions in the ImageSelectionController. Since we want to test that the array contents are equally the same independently on the order, we sort both sides of the assertion. This issue was not caught before since `electron-mocha` was reporting exit code 0 even when there were changes failing, causing the CI services to incorrectly support success. See: https://github.com/resin-io/etcher/pull/854 See: https://github.com/resin-io/etcher/pull/806 Signed-off-by: Juan Cruz Viotti --- tests/gui/pages/main.spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/gui/pages/main.spec.js b/tests/gui/pages/main.spec.js index d93ce3e3..002a16df 100644 --- a/tests/gui/pages/main.spec.js +++ b/tests/gui/pages/main.spec.js @@ -1,6 +1,7 @@ 'use strict'; const m = require('mochainon'); +const _ = require('lodash'); const angular = require('angular'); require('angular-mocks'); @@ -143,7 +144,7 @@ describe('Browser: MainPage', function() { }); const extensions = controller.mainSupportedExtensions.concat(controller.extraSupportedExtensions); - m.chai.expect(extensions).to.deep.equal(SupportedFormatsModel.getAllExtensions()); + m.chai.expect(_.sortBy(extensions)).to.deep.equal(_.sortBy(SupportedFormatsModel.getAllExtensions())); }); });