Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

CB-11836 Allow setting of 'ForegroundText' property via config.xml #195

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions spec/unit/AppxManifest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,27 @@ describe('AppxManifest', function () {
it('refineColor should leave CSS color name as is', function () {
expect(refineColor(CSS_COLOR_NAME)).toEqual(CSS_COLOR_NAME);
});

it('setForegroundText should change the ForegroundText property on non-Windows 10 platforms', function () {
var visualElementsWindows = AppxManifest.get(WINDOWS_MANIFEST).getVisualElements();
var visualElementsWindows10 = AppxManifest.get(WINDOWS_10_MANIFEST).getVisualElements();

var foregroundTextLight = 'light';
var foregroundTextDark = 'dark';

// Set to 'light'
visualElementsWindows.setForegroundText(foregroundTextLight);
expect(visualElementsWindows.getForegroundText()).toEqual(foregroundTextLight);

// Set to 'dark'
visualElementsWindows.setForegroundText(foregroundTextDark);
expect(visualElementsWindows.getForegroundText()).toEqual(foregroundTextDark);

Copy link
Contributor

@daserge daserge Sep 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also would be good to add a case for missing preference:

            // Simulate the absence of preference, should default to 'light'
            visualElementsWindows.setForegroundText(undefined);
            expect(visualElementsWindows.getForegroundText()).toEqual(foregroundTextLight);

// Returns nothing on Windows 10
visualElementsWindows10.setForegroundText(foregroundTextLight);
expect(visualElementsWindows10.getForegroundText()).toEqual(undefined);
});

});
});