Skip to content

Commit

Permalink
Prepare tests for menu with/without included setup
Browse files Browse the repository at this point in the history
  • Loading branch information
gasi committed Mar 2, 2018
1 parent 9e2f006 commit 027803f
Showing 1 changed file with 33 additions and 24 deletions.
57 changes: 33 additions & 24 deletions test/app/menu_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,43 @@ const PLATFORMS = [
},
];

const INCLUDE_SETUP_OPTIONS = [false];

describe('SignalMenu', () => {
describe('createTemplate', () => {
PLATFORMS.forEach(({ label, platform, fixture }) => {
context(`on ${label}`, () => {
it('should return correct template', () => {
const logger = {
error(message) {
throw new Error(message);
},
};
const options = {
openForums: null,
openNewBugForm: null,
openReleaseNotes: null,
openSupportPage: null,
platform,
setupAsNewDevice: null,
setupAsStandalone: null,
setupWithImport: null,
showAbout: null,
showDebugLog: null,
showWindow: null,
};
const appLocale = 'en';
const { messages } = loadLocale({ appLocale, logger });
context(label, () => {
INCLUDE_SETUP_OPTIONS.forEach((includeSetup) => {
const prefix = includeSetup ? 'with' : 'without';
context(`${prefix} included setup`, () => {
it('should return correct template', () => {
const logger = {
error(message) {
throw new Error(message);
},
};
const options = {
openForums: null,
openNewBugForm: null,
openReleaseNotes: null,
openSupportPage: null,
platform,
includeSetup,
setupAsNewDevice: null,
setupAsStandalone: null,
setupWithImport: null,
showAbout: null,
showDebugLog: null,
showSettings: null,
showWindow: null,
};
const appLocale = 'en';
const { messages } = loadLocale({ appLocale, logger });

const actual = SignalMenu.createTemplate(options, messages);
assert.deepEqual(actual, fixture);
const actual = SignalMenu.createTemplate(options, messages);
assert.deepEqual(actual, fixture);
});
});
});
});
});
Expand Down

0 comments on commit 027803f

Please sign in to comment.