mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
test(shared): ensure drive objects can contain extra properties (#1705)
The usbboot integration will bring in drive objects that include a lot more properties than the current drive objects. This commit ensures that the redux store can handle those extra properties. Change-Type: patch Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit is contained in:
parent
9f4712f1f8
commit
f3c8ec496a
@ -74,6 +74,41 @@ describe('Model: availableDrives', function () {
|
||||
m.chai.expect(availableDrives.getDrives()).to.deep.equal(drives)
|
||||
})
|
||||
|
||||
it('should be able to set drives with extra properties', function () {
|
||||
const drives = [
|
||||
{
|
||||
device: '/dev/sdb',
|
||||
description: 'Foo',
|
||||
size: '14G',
|
||||
mountpoint: '/mnt/foo',
|
||||
system: false,
|
||||
foo: {
|
||||
bar: 'baz',
|
||||
qux: 5
|
||||
},
|
||||
set: new Set()
|
||||
}
|
||||
]
|
||||
|
||||
availableDrives.setDrives(drives)
|
||||
m.chai.expect(availableDrives.getDrives()).to.deep.equal(drives)
|
||||
})
|
||||
|
||||
it('should be able to set drives with null sizes', function () {
|
||||
const drives = [
|
||||
{
|
||||
device: '/dev/sdb',
|
||||
description: 'Foo',
|
||||
size: null,
|
||||
mountpoint: '/mnt/foo',
|
||||
system: false
|
||||
}
|
||||
]
|
||||
|
||||
availableDrives.setDrives(drives)
|
||||
m.chai.expect(availableDrives.getDrives()).to.deep.equal(drives)
|
||||
})
|
||||
|
||||
describe('given no selected image and no selected drive', function () {
|
||||
beforeEach(function () {
|
||||
selectionState.removeDrive()
|
||||
|
Loading…
x
Reference in New Issue
Block a user