test: migrate to helpers & disabled tests list (#37513)

* test: migrate to helpers & disabled tests list

* can't disable a test suite

* correct condition

* address review comments
This commit is contained in:
Calvin 2023-04-04 07:48:51 -06:00 committed by GitHub
parent 58f3c0ee37
commit b8a21dbcd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 95 additions and 117 deletions

View file

@ -1,5 +1,6 @@
import { expect } from 'chai';
import { screen } from 'electron/main';
import { ifit } from './lib/spec-helpers';
describe('screen module', () => {
describe('methods reassignment', () => {
@ -28,8 +29,7 @@ describe('screen module', () => {
expect(display).to.be.an('object');
});
it('has the correct non-object properties', function () {
if (process.platform === 'linux') this.skip();
ifit(process.platform !== 'linux')('has the correct non-object properties', function () {
const display = screen.getPrimaryDisplay();
expect(display).to.have.property('scaleFactor').that.is.a('number');
@ -46,8 +46,7 @@ describe('screen module', () => {
expect(display).to.have.property('displayFrequency').that.is.a('number');
});
it('has a size object property', function () {
if (process.platform === 'linux') this.skip();
ifit(process.platform !== 'linux')('has a size object property', function () {
const display = screen.getPrimaryDisplay();
expect(display).to.have.property('size').that.is.an('object');
@ -56,8 +55,7 @@ describe('screen module', () => {
expect(size).to.have.property('height').that.is.greaterThan(0);
});
it('has a workAreaSize object property', function () {
if (process.platform === 'linux') this.skip();
ifit(process.platform !== 'linux')('has a workAreaSize object property', function () {
const display = screen.getPrimaryDisplay();
expect(display).to.have.property('workAreaSize').that.is.an('object');
@ -66,8 +64,7 @@ describe('screen module', () => {
expect(workAreaSize).to.have.property('height').that.is.greaterThan(0);
});
it('has a bounds object property', function () {
if (process.platform === 'linux') this.skip();
ifit(process.platform !== 'linux')('has a bounds object property', function () {
const display = screen.getPrimaryDisplay();
expect(display).to.have.property('bounds').that.is.an('object');