Lint tests
This commit is contained in:
parent
00748889f9
commit
1aa4fcae08
1 changed files with 17 additions and 13 deletions
|
@ -457,56 +457,60 @@ describe('app module', function () {
|
|||
})
|
||||
})
|
||||
|
||||
describe('getFileIcon() API', function() {
|
||||
describe('getFileIcon() API', function () {
|
||||
const iconPath = path.join(process.cwd(), 'fixtures/assets/icon.ico')
|
||||
const sizes = {
|
||||
small: 16,
|
||||
normal: 32,
|
||||
large: 48
|
||||
};
|
||||
}
|
||||
|
||||
it('fetches non-empty icon', function(done) {
|
||||
app.getFileIcon(iconPath, function(err, icon) {
|
||||
it('fetches non-empty icon', function (done) {
|
||||
app.getFileIcon(iconPath, function (err, icon) {
|
||||
assert.equal(err, null)
|
||||
assert.equal(icon.isEmpty(), false)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('fetches normal size by default', function(done) {
|
||||
app.getFileIcon(iconPath, function(err, icon) {
|
||||
it('fetches normal size by default', function (done) {
|
||||
app.getFileIcon(iconPath, function (err, icon) {
|
||||
const size = icon.getSize()
|
||||
assert.equal(err, null)
|
||||
assert.equal(size.height, sizes.normal)
|
||||
assert.equal(size.width, sizes.normal)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
describe('size option', function() {
|
||||
it('fetches small icons', function(done) {
|
||||
app.getFileIcon(iconPath, { size: 'small' }, function(err, icon) {
|
||||
describe('size option', function () {
|
||||
it('fetches small icons', function (done) {
|
||||
app.getFileIcon(iconPath, { size: 'small' }, function (err, icon) {
|
||||
const size = icon.getSize()
|
||||
assert.equal(err, null)
|
||||
assert.equal(size.height, sizes.small)
|
||||
assert.equal(size.width, sizes.small)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('fetches normal icons', function(done) {
|
||||
app.getFileIcon(iconPath, { size: 'normal' }, function(err, icon) {
|
||||
it('fetches normal icons', function (done) {
|
||||
app.getFileIcon(iconPath, { size: 'normal' }, function (err, icon) {
|
||||
const size = icon.getSize()
|
||||
assert.equal(err, null)
|
||||
assert.equal(size.height, sizes.normal)
|
||||
assert.equal(size.width, sizes.normal)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('fetches large icons', function(done) {
|
||||
it('fetches large icons', function (done) {
|
||||
if (process.platform === 'darwin') {
|
||||
done() // macOS does not support large icons
|
||||
}
|
||||
app.getFileIcon(iconPath, { size: 'normal' }, function(err, icon) {
|
||||
app.getFileIcon(iconPath, { size: 'normal' }, function (err, icon) {
|
||||
const size = icon.getSize()
|
||||
assert.equal(err, null)
|
||||
assert.equal(size.height, sizes.normal)
|
||||
assert.equal(size.width, sizes.normal)
|
||||
done()
|
||||
|
|
Loading…
Add table
Reference in a new issue