Merge pull request #302 from Osmose/sync-client-counts

Add sync client counts to filter expression context. (#289)
This commit is contained in:
Michael Kelly 2016-10-21 13:36:40 -07:00 коммит произвёл GitHub
Родитель 27e5486623 9853c80ebb
Коммит b6c53a533e
4 изменённых файлов: 35 добавлений и 2 удалений

Просмотреть файл

@ -166,6 +166,9 @@ export default class NormandyDriver {
},
sync(data) {
client.syncSetup = data.setup;
client.syncDesktopDevices = data.desktopDevices || 0;
client.syncMobileDevices = data.mobileDevices || 0;
client.syncTotalDevices = data.totalDevices || 0;
},
};

Просмотреть файл

@ -109,7 +109,10 @@ describe('Normandy Driver', () => {
switch (config) {
case 'sync':
return cb({
setup: false,
setup: true,
desktopDevices: 1,
mobileDevices: 2,
totalDevices: 3,
});
case 'appinfo':
return cb({
@ -128,7 +131,10 @@ describe('Normandy Driver', () => {
const driver = new NormandyDriver(uitour);
const client = await driver.client();
expect(client.syncSetup).toEqual(false);
expect(client.syncSetup).toEqual(true);
expect(client.syncDesktopDevices).toEqual(1);
expect(client.syncMobileDevices).toEqual(2);
expect(client.syncTotalDevices).toEqual(3);
expect(client.distribution).toEqual('funnelcake85');
expect(client.isDefaultBrowser).toEqual(true);
expect(client.searchEngine).toEqual('Yahoo');

Просмотреть файл

@ -162,6 +162,15 @@ The driver object contains the following attributes:
String containing the user's default search engine identifier.
syncSetup
Boolean containing whether the user has set up Firefox Sync.
syncDesktopDevices
Integer specifying the number of desktop clients the user has added to
their Firefox Sync account.
syncMobileDevices
Integer specifying the number of mobile clients the user has added to
their Firefox Sync account.
syncTotalDevices
Integer specifying the total number of clients the user has added to their
Firefox Sync account.
plugins
An object mapping of plugin names to :js:class:`Plugin` objects describing
the plugins installed on the client.

Просмотреть файл

@ -126,6 +126,21 @@ filter expressions.
Boolean containing whether the user has set up Firefox Sync.
.. js:attribute:: normandy.syncDesktopDevices
Integer specifying the number of desktop clients the user has added to their
Firefox Sync account.
.. js:attribute:: normandy.syncMobileDevices
Integer specifying the number of mobile clients the user has added to their
Firefox Sync account.
.. js:attribute:: normandy.syncTotalDevices
Integer specifying the total number of clients the user has added to their
Firefox Sync account.
.. js:attribute:: normandy.plugins
An object mapping of plugin names to :js:class:`Plugin` objects describing