mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Sort browser apps alphabetically. Sort again in the detailed device list as we currently have old data left over and we may wish to change the sorting later anyway. Should not be terribly bad due to most devices only having one or two browsers.
This commit is contained in:
parent
7071876030
commit
3257665ec2
2 changed files with 14 additions and 3 deletions
|
@ -49,6 +49,12 @@ module.exports = syrup.serial()
|
|||
return acc
|
||||
}
|
||||
|
||||
function compareIgnoreCase(a, b) {
|
||||
var la = (a || '').toLowerCase()
|
||||
, lb = (b || '').toLowerCase()
|
||||
return la === lb ? 0 : (la < lb ? -1 : 1)
|
||||
}
|
||||
|
||||
function updateBrowsers(data) {
|
||||
log.info('Updating browser list')
|
||||
push.send([
|
||||
|
@ -56,7 +62,9 @@ module.exports = syrup.serial()
|
|||
, wireutil.envelope(new wire.DeviceBrowserMessage(
|
||||
options.serial
|
||||
, data.selected
|
||||
, data.apps.reduce(appReducer, [])
|
||||
, data.apps.reduce(appReducer, []).sort(function(appA, appB) {
|
||||
return compareIgnoreCase(appA.name, appB.name)
|
||||
})
|
||||
))
|
||||
])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue