Adds size test for radiobutton and checkbox (#207)
This commit is contained in:
parent
97c67219e2
commit
dfdb1907c7
@ -1,6 +1,7 @@
|
||||
import { QCheckBox } from '../QCheckBox';
|
||||
import { QIcon } from '../../QtGui/QIcon';
|
||||
import path from 'path';
|
||||
import { QSize } from '../../QtCore/QSize';
|
||||
|
||||
describe('QCheckBox', () => {
|
||||
it('instantiate a button instance', () => {
|
||||
@ -26,4 +27,14 @@ describe('QCheckBox', () => {
|
||||
button.setChecked(false);
|
||||
expect(button.isChecked()).toEqual(false);
|
||||
});
|
||||
it('setIconSize', () => {
|
||||
const button = new QCheckBox();
|
||||
const testImagePath = path.resolve(__dirname, 'assets', 'nodegui.png');
|
||||
const icon = new QIcon(testImagePath);
|
||||
button.setIcon(icon);
|
||||
button.setIconSize(new QSize(111, 111));
|
||||
const returnedSize = button.iconSize();
|
||||
expect(returnedSize.width()).toBe(111);
|
||||
expect(returnedSize.height()).toBe(111);
|
||||
});
|
||||
});
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { QRadioButton } from '../QRadioButton';
|
||||
import { QIcon } from '../../QtGui/QIcon';
|
||||
import path from 'path';
|
||||
import { QSize } from '../../QtCore/QSize';
|
||||
|
||||
describe('QRadioButton', () => {
|
||||
it('instantiate a button instance', () => {
|
||||
@ -19,4 +20,14 @@ describe('QRadioButton', () => {
|
||||
button.setIcon(icon);
|
||||
expect(QIcon.fromQVariant(button.property('icon')).cacheKey()).toEqual(icon.cacheKey());
|
||||
});
|
||||
it('setIconSize', () => {
|
||||
const button = new QRadioButton();
|
||||
const testImagePath = path.resolve(__dirname, 'assets', 'nodegui.png');
|
||||
const icon = new QIcon(testImagePath);
|
||||
button.setIcon(icon);
|
||||
button.setIconSize(new QSize(111, 111));
|
||||
const returnedSize = button.iconSize();
|
||||
expect(returnedSize.width()).toBe(111);
|
||||
expect(returnedSize.height()).toBe(111);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user