Skip to content

Commit 6b3d293

Browse files
committed
Apply proposed changes to assert array lengths in various unit tests.
1 parent d6c4f15 commit 6b3d293

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

tests/unit/specs/WguAppTemplate.spec.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ describe('WguAppTpl.vue', () => {
108108

109109
const moduleData = vm.getModuleWinData('floating');
110110

111-
expect(moduleData).to.be.an('array');
112-
expect(moduleData.length).to.equal(1);
111+
expect(moduleData).to.be.an('array').that.has.lengthOf(1);
113112
expect(moduleData[0].type).to.equal('wgu-infoclick-win');
114113
expect(moduleData[0].target).to.equal('menu');
115114
expect(moduleData[0].draggable).to.be.false;
@@ -133,8 +132,7 @@ describe('WguAppTpl.vue', () => {
133132

134133
const moduleData = vm.getModuleWinData('sidebar');
135134

136-
expect(moduleData).to.be.an('array');
137-
expect(moduleData.length).to.equal(1);
135+
expect(moduleData).to.be.an('array').that.has.lengthOf(1);
138136
expect(moduleData[0].type).to.equal('wgu-infoclick-win');
139137
expect(moduleData[0].target).to.equal('menu');
140138
});
@@ -162,8 +160,7 @@ describe('WguAppTpl.vue', () => {
162160

163161
const moduleData = vm.getModuleWinData('floating');
164162

165-
expect(moduleData).to.be.an('array');
166-
expect(moduleData.length).to.equal(2);
163+
expect(moduleData).to.be.an('array').that.has.lengthOf(2);
167164
expect(moduleData[0].type).to.equal('wgu-helpwin-win');
168165
expect(moduleData[0].target).to.equal('toolbar');
169166
expect(moduleData[1].type).to.equal('wgu-helpwin-win');

tests/unit/specs/components/AppHeader.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ describe('AppHeader.vue', () => {
9191
vm = comp.vm;
9292

9393
const moduleData = vm.getModuleButtons('toolbar');
94-
expect(moduleData).to.be.an('array');
95-
expect(moduleData.length).to.equal(2);
94+
expect(moduleData).to.be.an('array').that.has.lengthOf(2);
9695
expect(moduleData[0].type).to.equal('wgu-helpwin-btn');
9796
expect(moduleData[0].target).to.equal('toolbar');
9897
expect(moduleData[1].type).to.equal('wgu-helpwin-btn');

0 commit comments

Comments
 (0)