Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(devices): Add test for unicode device names. (#1758) r=vladikoff
Browse files Browse the repository at this point in the history
  • Loading branch information
rfk authored and vladikoff committed May 5, 2017
1 parent 4948a7e commit 46861c3
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/remote/device_tests.js
Expand Up @@ -133,6 +133,43 @@ describe('remote device', function() {
}
)

it(
'device registration with unicode characters in the name',
() => {
var email = server.uniqueEmail()
var password = 'test password'
return Client.create(config.publicUrl, email, password)
.then(
function (client) {
var deviceInfo = {
// That's a beta, and a CJK character from https://bugzilla.mozilla.org/show_bug.cgi?id=1348298
name: 'Firefox \u5728 \u03b2 test',
type: 'desktop',
}
return client.updateDevice(deviceInfo)
.then(
function (device) {
assert.ok(device.id, 'device.id was set')
assert.ok(device.createdAt > 0, 'device.createdAt was set')
assert.equal(device.name, deviceInfo.name, 'device.name is correct')
}
)
.then(
function () {
return client.devices()
}
)
.then(
function (devices) {
assert.equal(devices.length, 1, 'devices returned one item')
assert.equal(devices[0].name, deviceInfo.name, 'devices returned correct name')
}
)
}
)
}
)

it(
'device registration without required name parameter',
() => {
Expand Down

0 comments on commit 46861c3

Please sign in to comment.