diff --git a/ui/src/components/dialog/QDialog.test.js b/ui/src/components/dialog/QDialog.test.js index e28cedfb67d..df622b82f73 100644 --- a/ui/src/components/dialog/QDialog.test.js +++ b/ui/src/components/dialog/QDialog.test.js @@ -97,7 +97,7 @@ describe('[QDialog API]', () => { test.todo('has effect', () => { const propVal = 'fade' - const wrapper = mount(QDialog, { + mount(QDialog, { props: { transitionShow: propVal } diff --git a/ui/src/components/space/QSpace.test.js b/ui/src/components/space/QSpace.test.js index 461a0dfab09..697c78c8a77 100644 --- a/ui/src/components/space/QSpace.test.js +++ b/ui/src/components/space/QSpace.test.js @@ -10,7 +10,8 @@ describe('[QSpace API]', () => { expect( wrapper.get('div.q-space') - ).toBeDefined() + .exists() + ).toBe(true) }) }) }) diff --git a/ui/src/composables/private/use-form.test.js b/ui/src/composables/private/use-form.test.js index e7d902bfbe8..83971a3b4cd 100644 --- a/ui/src/composables/private/use-form.test.js +++ b/ui/src/composables/private/use-form.test.js @@ -12,7 +12,7 @@ describe('[useForm API]', () => { modelValue: 'MyModelValue' }) - expect(result).toBeTruthy() + expect(result).toBeTypeOf('object') expect(result.name).toBe('MyName') expect(result.value).toBe('MyModelValue') }) @@ -28,14 +28,14 @@ describe('[useForm API]', () => { fn(acc, 'push') fn(acc, 'push', ' MyClassName') - expect(acc.length).toBe(2) + expect(acc).toHaveLength(2) expect(acc[ 0 ].type).toBe('input') - expect(Object.keys(acc[ 0 ].props).length).toBe(1) + expect(Object.keys(acc[ 0 ].props)).toHaveLength(1) expect(acc[ 0 ].props.class).toBe('hidden') expect(acc[ 1 ].type).toBe('input') - expect(Object.keys(acc[ 1 ].props).length).toBe(1) + expect(Object.keys(acc[ 1 ].props)).toHaveLength(1) expect(acc[ 1 ].props.class).toBe('hidden MyClassName') }) @@ -51,15 +51,15 @@ describe('[useForm API]', () => { fn(acc, 'push') fn(acc, 'push', ' MyClassName') - expect(acc.length).toBe(2) + expect(acc).toHaveLength(2) expect(acc[ 0 ].type).toBe('input') - expect(Object.keys(acc[ 0 ].props).length).toBe(2) + expect(Object.keys(acc[ 0 ].props)).toHaveLength(2) expect(acc[ 0 ].props.class).toBe('hidden') expect(acc[ 0 ].props.myAttr).toBe('MyAttrValue') expect(acc[ 1 ].type).toBe('input') - expect(Object.keys(acc[ 1 ].props).length).toBe(2) + expect(Object.keys(acc[ 1 ].props)).toHaveLength(2) expect(acc[ 1 ].props.class).toBe('hidden MyClassName') expect(acc[ 1 ].props.myAttr).toBe('MyAttrValue') }) diff --git a/ui/src/composables/private/use-ratio.test.js b/ui/src/composables/private/use-ratio.test.js index 22c23c55a24..b56555c7480 100644 --- a/ui/src/composables/private/use-ratio.test.js +++ b/ui/src/composables/private/use-ratio.test.js @@ -7,24 +7,24 @@ describe('[useRatio API]', () => { describe('[(function)default]', () => { test('should return padding when ratio is supplied', () => { const { value } = useRatio({ ratio: 2 }) - expect(value).toBeTruthy() + expect(value).toBeTypeOf('object') expect(value.paddingBottom).toBeTruthy() }) test('should return padding when naturalRatio is supplied', () => { const { value } = useRatio({}, { value: 2 }) - expect(value).toBeTruthy() + expect(value).toBeTypeOf('object') expect(value.paddingBottom).toBeTruthy() }) test('should not return padding when invalid params', () => { const { value } = useRatio({ ratio: 'a' }) - expect(value).toBeFalsy() + expect(value).toBeNull() }) test('should not return padding when no params are supplied', () => { const { value } = useRatio({}) - expect(value).toBeFalsy() + expect(value).toBeNull() }) }) }) diff --git a/ui/src/composables/private/use-size.test.js b/ui/src/composables/private/use-size.test.js index f4c4b6bfd64..8063eb2efca 100644 --- a/ui/src/composables/private/use-size.test.js +++ b/ui/src/composables/private/use-size.test.js @@ -7,7 +7,7 @@ describe('[useSize API]', () => { describe('[(variable)useSizeDefaults]', () => { test('is defined correctly', () => { expect(useSizeDefaults).toBeTypeOf('object') - expect(Object.keys(useSizeDefaults).length).not.toBe(0) + expect(Object.keys(useSizeDefaults)).not.toHaveLength(0) }) }) }) diff --git a/ui/src/composables/use-id.test.js b/ui/src/composables/use-id.test.js index c96030b4bd0..558d1b72db6 100644 --- a/ui/src/composables/use-id.test.js +++ b/ui/src/composables/use-id.test.js @@ -4,21 +4,19 @@ import { defineComponent } from 'vue' import useId from './use-id.js' +const uidRE = /^f_/ + describe('[useId API]', () => { describe('[Functions]', () => { describe('[(function)default]', () => { test('useId()', () => { const { value: result } = useId() - - expect(result).toBeTruthy() - expect(result.startsWith('f_')).toBe(true) + expect(result).toMatch(uidRE) }) test('useId({})', () => { const { value: result } = useId({}) - - expect(result).toBeTruthy() - expect(result.startsWith('f_')).toBe(true) + expect(result).toMatch(uidRE) }) test('useId({ getValue })', () => { @@ -34,8 +32,7 @@ describe('[useId API]', () => { getValue: () => null }) - expect(result).toBeTruthy() - expect(result.startsWith('f_')).toBe(true) + expect(result).toMatch(uidRE) }) test('useId({ getValue: () => null, required: true })', () => { @@ -44,8 +41,7 @@ describe('[useId API]', () => { required: true }) - expect(result).toBeTruthy() - expect(result.startsWith('f_')).toBe(true) + expect(result).toMatch(uidRE) }) test('useId({ getValue: () => null, required: false })', () => { @@ -54,21 +50,22 @@ describe('[useId API]', () => { required: false }) - expect(result).toBe(null) + expect(result).toBeNull() }) - test('can be used in a Component', () => { - const TestComponent = defineComponent({ - template: '
', - setup () { - // eslint-disable-next-line - const result = useId() - return { result } - } - }) + test('can be used in a Vue Component', () => { + const wrapper = mount( + defineComponent({ + template: '', + setup () { + // eslint-disable-next-line + const result = useId() + return { result } + } + }) + ) - const wrapper = mount(TestComponent) - expect(wrapper.vm.result.startsWith('f_')).toBe(true) + expect(wrapper.vm.result).toMatch(/^f_/) }) }) }) diff --git a/ui/src/plugins/icon-set/IconSet.test.js b/ui/src/plugins/icon-set/IconSet.test.js index cfd1c0a8be8..e615a85bcfc 100644 --- a/ui/src/plugins/icon-set/IconSet.test.js +++ b/ui/src/plugins/icon-set/IconSet.test.js @@ -180,9 +180,8 @@ describe('[IconSet API]', () => { test('should be callable', () => { const wrapper = mountPlugin() - expect(IconSet.set).toBeTypeOf('function') - expect(IconSet.set( - { + expect( + IconSet.set({ name: 'new-icon-set', type: { positive: 'check_circle', @@ -322,25 +321,25 @@ describe('[IconSet API]', () => { removeQueue: 'clear_all', removeUploaded: 'done_all' } - } - )).toBeUndefined() + }) + ).toBeUndefined() expect(IconSet.props.name).toBe('new-icon-set') expect(wrapper.vm.$q.iconSet.name).toBe('new-icon-set') }) test('should work with an imported icon set', async () => { - const wrapper = mountPlugin() + const { vm: { $q } } = mountPlugin() const { default: newIconSet } = await import('quasar/icon-set/fontawesome-v6.mjs') IconSet.set(newIconSet) expect(IconSet.props.name).toBe(newIconSet.name) - expect(wrapper.vm.$q.iconSet.name).toBe(newIconSet.name) + expect($q.iconSet.name).toBe(newIconSet.name) const { default: anotherIconSet } = await import('quasar/icon-set/ionicons-v4.mjs') - wrapper.vm.$q.iconSet.set(anotherIconSet) + $q.iconSet.set(anotherIconSet) expect(IconSet.props.name).toBe(anotherIconSet.name) - expect(wrapper.vm.$q.iconSet.name).toBe(anotherIconSet.name) + expect($q.iconSet.name).toBe(anotherIconSet.name) }) }) }) diff --git a/ui/src/plugins/lang/Lang.test.js b/ui/src/plugins/lang/Lang.test.js index 2645aecd3ea..0351feea064 100644 --- a/ui/src/plugins/lang/Lang.test.js +++ b/ui/src/plugins/lang/Lang.test.js @@ -114,15 +114,15 @@ describe('[Lang API]', () => { }) test('can be set', () => { - const wrapper = mountPlugin() + const { vm: { $q } } = mountPlugin() Lang.props.nativeName = 'new-lang' expect(Lang.props.nativeName).toBe('new-lang') - expect(wrapper.vm.$q.lang.nativeName).toBe('new-lang') + expect($q.lang.nativeName).toBe('new-lang') - wrapper.vm.$q.lang.nativeName = 'another-lang' + $q.lang.nativeName = 'another-lang' expect(Lang.props.nativeName).toBe('another-lang') - expect(wrapper.vm.$q.lang.nativeName).toBe('another-lang') + expect($q.lang.nativeName).toBe('another-lang') }) }) }) @@ -132,9 +132,8 @@ describe('[Lang API]', () => { test('should be callable', () => { const wrapper = mountPlugin() - expect(Lang.set).toBeTypeOf('function') - expect(Lang.set( - { + expect( + Lang.set({ isoName: 'en-US', nativeName: 'New Language', rtl: true, @@ -223,25 +222,25 @@ describe('[Lang API]', () => { noNodes: 'No nodes available', noResults: 'No matching nodes found' } - } - )).toBeUndefined() + }) + ).toBeUndefined() expect(Lang.props.nativeName).toBe('New Language') expect(wrapper.vm.$q.lang.nativeName).toBe('New Language') }) test('should work with an imported lang pack', async () => { - const wrapper = mountPlugin() + const { vm: { $q } } = mountPlugin() const { default: deLang } = await import('quasar/lang/de-DE.mjs') Lang.set(deLang) expect(Lang.props.nativeName).toBe(deLang.nativeName) - expect(wrapper.vm.$q.lang.nativeName).toBe(deLang.nativeName) + expect($q.lang.nativeName).toBe(deLang.nativeName) const { default: itLang } = await import('quasar/lang/it.mjs') - wrapper.vm.$q.lang.set(itLang) + $q.lang.set(itLang) expect(Lang.props.nativeName).toBe(itLang.nativeName) - expect(wrapper.vm.$q.lang.nativeName).toBe(itLang.nativeName) + expect($q.lang.nativeName).toBe(itLang.nativeName) }) }) @@ -249,16 +248,18 @@ describe('[Lang API]', () => { test('should be callable', () => { const wrapper = mountPlugin() - expect(Lang.getLocale).toBeTypeOf('function') - expect(Lang.getLocale()).$any([ + expect( + Lang.getLocale() + ).$any([ expect.any(String), - void 0 + undefined ]) - expect(wrapper.vm.$q.lang.getLocale).toBeTypeOf('function') - expect(wrapper.vm.$q.lang.getLocale()).$any([ + expect( + wrapper.vm.$q.lang.getLocale() + ).$any([ expect.any(String), - void 0 + undefined ]) }) }) diff --git a/ui/src/plugins/local-storage/LocalStorage.test.js b/ui/src/plugins/local-storage/LocalStorage.test.js index 882fffcfba9..9808161fcc1 100644 --- a/ui/src/plugins/local-storage/LocalStorage.test.js +++ b/ui/src/plugins/local-storage/LocalStorage.test.js @@ -17,7 +17,7 @@ describe('[LocalStorage API]', () => { expect($q.localStorage).toBeDefined() expect($q.localStorage).toBeTypeOf('object') - expect(Object.keys($q.localStorage).length).not.toBe(0) + expect(Object.keys($q.localStorage)).not.toHaveLength(0) expect(LocalStorage).toMatchObject($q.localStorage) }) @@ -27,7 +27,6 @@ describe('[LocalStorage API]', () => { describe('[(method)has]', () => { test('should be callable', () => { mountPlugin() - expect(LocalStorage.has).toBeTypeOf('function') expect(LocalStorage.has('has')).toBe(false) LocalStorage.set('has', 'rstoenescu') @@ -43,7 +42,6 @@ describe('[LocalStorage API]', () => { describe('[(method)getLength]', () => { test('should be callable', () => { mountPlugin() - expect(LocalStorage.getLength).toBeTypeOf('function') const len = LocalStorage.getLength() expect(len).toBeTypeOf('number') @@ -62,8 +60,9 @@ describe('[LocalStorage API]', () => { test('should be callable', () => { mountPlugin() - expect(LocalStorage.getItem).toBeTypeOf('function') - expect(LocalStorage.getItem('getItem')).toBeNull() + expect( + LocalStorage.getItem('getItem') + ).toBeNull() }) test('matches $q API', () => { @@ -79,7 +78,6 @@ describe('[LocalStorage API]', () => { // ensure at least one element is defined LocalStorage.set('getIndex', 'rstoenescu') - expect(LocalStorage.getIndex).toBeTypeOf('function') expect( LocalStorage.getIndex(0) ).$any([ @@ -107,7 +105,6 @@ describe('[LocalStorage API]', () => { // ensure at least one element is defined LocalStorage.set('getKey', 'rstoenescu') - expect(LocalStorage.getKey).toBeTypeOf('function') expect( LocalStorage.getKey(0) ).toBeTypeOf('string') @@ -123,14 +120,12 @@ describe('[LocalStorage API]', () => { test('should be callable', () => { mountPlugin() - expect(LocalStorage.getAll).toBeTypeOf('function') - // ensure at least one element is defined LocalStorage.set('getAll', 'rstoenescu') const result = LocalStorage.getAll() expect(result).toBeTypeOf('object') - expect(Object.keys(result).length).not.toBe(0) + expect(Object.keys(result)).not.toHaveLength(0) }) test('matches $q API', () => { @@ -146,9 +141,13 @@ describe('[LocalStorage API]', () => { // ensure at least one element is defined LocalStorage.set('getAllKeys', 'rstoenescu') - expect(LocalStorage.getAllKeys).toBeTypeOf('function') - expect(Array.isArray(LocalStorage.getAllKeys())).toBe(true) - expect(LocalStorage.getAllKeys()).toContain('getAllKeys') + expect( + Array.isArray(LocalStorage.getAllKeys()) + ).toBe(true) + + expect( + LocalStorage.getAllKeys() + ).toContain('getAllKeys') }) test('matches $q API', () => { @@ -161,8 +160,6 @@ describe('[LocalStorage API]', () => { test('should be callable', () => { mountPlugin() - expect(LocalStorage.set).toBeTypeOf('function') - expect( LocalStorage.set('set', 'rstoenescu') ).toBeUndefined() @@ -269,10 +266,10 @@ describe('[LocalStorage API]', () => { LocalStorage.getItem('remove') ).toBe(5) - expect(LocalStorage.remove).toBeTypeOf('function') expect( LocalStorage.remove('remove') ).toBeUndefined() + expect( LocalStorage.getItem('remove') ).toBeNull() @@ -291,7 +288,6 @@ describe('[LocalStorage API]', () => { LocalStorage.set('clear', 5) expect(LocalStorage.getItem('clear')).toBe(5) - expect(LocalStorage.clear).toBeTypeOf('function') expect(LocalStorage.clear()).toBeUndefined() expect(LocalStorage.getItem('clear')).toBeNull() @@ -311,7 +307,6 @@ describe('[LocalStorage API]', () => { LocalStorage.set('isEmpty', 5) expect(LocalStorage.getItem('isEmpty')).toBe(5) - expect(LocalStorage.isEmpty).toBeTypeOf('function') expect(LocalStorage.isEmpty()).toBe(false) LocalStorage.clear() diff --git a/ui/src/plugins/platform/Platform.test.js b/ui/src/plugins/platform/Platform.test.js index 701909e228b..7cc97d9a7df 100644 --- a/ui/src/plugins/platform/Platform.test.js +++ b/ui/src/plugins/platform/Platform.test.js @@ -70,7 +70,7 @@ describe('[Platform API]', () => { const actualKeys = Object.keys(Platform.is) - expect(actualKeys.length).not.toBe(0) + expect(actualKeys).not.toHaveLength(0) expect(actualKeys).toSatisfy( keys => keys.every(key => expected[ key ] !== void 0) diff --git a/ui/src/plugins/session-storage/SessionStorage.test.js b/ui/src/plugins/session-storage/SessionStorage.test.js index 04f6d23dda4..1de8d4b410e 100644 --- a/ui/src/plugins/session-storage/SessionStorage.test.js +++ b/ui/src/plugins/session-storage/SessionStorage.test.js @@ -17,7 +17,7 @@ describe('[SessionStorage API]', () => { expect($q.sessionStorage).toBeDefined() expect($q.sessionStorage).toBeTypeOf('object') - expect(Object.keys($q.sessionStorage).length).not.toBe(0) + expect(Object.keys($q.sessionStorage)).not.toHaveLength(0) expect(SessionStorage).toMatchObject($q.sessionStorage) }) @@ -27,7 +27,6 @@ describe('[SessionStorage API]', () => { describe('[(method)has]', () => { test('should be callable', () => { mountPlugin() - expect(SessionStorage.has).toBeTypeOf('function') expect(SessionStorage.has('has')).toBe(false) SessionStorage.set('has', 'rstoenescu') @@ -43,7 +42,6 @@ describe('[SessionStorage API]', () => { describe('[(method)getLength]', () => { test('should be callable', () => { mountPlugin() - expect(SessionStorage.getLength).toBeTypeOf('function') const len = SessionStorage.getLength() expect(len).toBeTypeOf('number') @@ -62,8 +60,9 @@ describe('[SessionStorage API]', () => { test('should be callable', () => { mountPlugin() - expect(SessionStorage.getItem).toBeTypeOf('function') - expect(SessionStorage.getItem('getItem')).toBeNull() + expect( + SessionStorage.getItem('getItem') + ).toBeNull() }) test('matches $q API', () => { @@ -79,7 +78,6 @@ describe('[SessionStorage API]', () => { // ensure at least one element is defined SessionStorage.set('getIndex', 'rstoenescu') - expect(SessionStorage.getIndex).toBeTypeOf('function') expect( SessionStorage.getIndex(0) ).$any([ @@ -107,7 +105,6 @@ describe('[SessionStorage API]', () => { // ensure at least one element is defined SessionStorage.set('getKey', 'rstoenescu') - expect(SessionStorage.getKey).toBeTypeOf('function') expect( SessionStorage.getKey(0) ).toBeTypeOf('string') @@ -123,14 +120,12 @@ describe('[SessionStorage API]', () => { test('should be callable', () => { mountPlugin() - expect(SessionStorage.getAll).toBeTypeOf('function') - // ensure at least one element is defined SessionStorage.set('getAll', 'rstoenescu') const result = SessionStorage.getAll() expect(result).toBeTypeOf('object') - expect(Object.keys(result).length).not.toBe(0) + expect(Object.keys(result)).not.toHaveLength(0) }) test('matches $q API', () => { @@ -146,9 +141,13 @@ describe('[SessionStorage API]', () => { // ensure at least one element is defined SessionStorage.set('getAllKeys', 'rstoenescu') - expect(SessionStorage.getAllKeys).toBeTypeOf('function') - expect(Array.isArray(SessionStorage.getAllKeys())).toBe(true) - expect(SessionStorage.getAllKeys()).toContain('getAllKeys') + expect( + Array.isArray(SessionStorage.getAllKeys()) + ).toBe(true) + + expect( + SessionStorage.getAllKeys() + ).toContain('getAllKeys') }) test('matches $q API', () => { @@ -161,8 +160,6 @@ describe('[SessionStorage API]', () => { test('should be callable', () => { mountPlugin() - expect(SessionStorage.set).toBeTypeOf('function') - expect( SessionStorage.set('set', 'rstoenescu') ).toBeUndefined() @@ -269,10 +266,10 @@ describe('[SessionStorage API]', () => { SessionStorage.getItem('remove') ).toBe(5) - expect(SessionStorage.remove).toBeTypeOf('function') expect( SessionStorage.remove('remove') ).toBeUndefined() + expect( SessionStorage.getItem('remove') ).toBeNull() @@ -291,7 +288,6 @@ describe('[SessionStorage API]', () => { SessionStorage.set('clear', 5) expect(SessionStorage.getItem('clear')).toBe(5) - expect(SessionStorage.clear).toBeTypeOf('function') expect(SessionStorage.clear()).toBeUndefined() expect(SessionStorage.getItem('clear')).toBeNull() @@ -311,7 +307,6 @@ describe('[SessionStorage API]', () => { SessionStorage.set('isEmpty', 5) expect(SessionStorage.getItem('isEmpty')).toBe(5) - expect(SessionStorage.isEmpty).toBeTypeOf('function') expect(SessionStorage.isEmpty()).toBe(false) SessionStorage.clear() diff --git a/ui/src/utils/private/web-storage.test.js b/ui/src/utils/private/web-storage.test.js index 0d00c565643..6cadc21f0e1 100644 --- a/ui/src/utils/private/web-storage.test.js +++ b/ui/src/utils/private/web-storage.test.js @@ -21,19 +21,19 @@ describe('[webStorage API]', () => { describe('[(function)getEmptyStorage]', () => { test('has correct return value', () => { const result = getEmptyStorage() - expect(result).toEqual(objectDefinition) + expect(result).toStrictEqual(objectDefinition) }) }) describe('[(function)getStorage]', () => { test('has correct return value for local', () => { const local = getStorage('local') - expect(local).toEqual(objectDefinition) + expect(local).toStrictEqual(objectDefinition) }) test('has correct return value for session', () => { const session = getStorage('session') - expect(session).toEqual(objectDefinition) + expect(session).toStrictEqual(objectDefinition) }) }) }) diff --git a/ui/src/utils/uid.test.js b/ui/src/utils/uid.test.js index 41ff14df928..59b2d6ed284 100644 --- a/ui/src/utils/uid.test.js +++ b/ui/src/utils/uid.test.js @@ -8,7 +8,7 @@ describe('[uid API]', () => { test('has correct return value', () => { const result = uid() expect(result).toBeTypeOf('string') - expect(result.length).toBe(36) + expect(result).toHaveLength(36) expect(uid()).not.toBe(result) }) diff --git a/ui/testing/specs/generators/generator.composable.js b/ui/testing/specs/generators/generator.composable.js index 221b68bb347..7cf8ba3e7c5 100644 --- a/ui/testing/specs/generators/generator.composable.js +++ b/ui/testing/specs/generators/generator.composable.js @@ -30,7 +30,7 @@ function createVariableTest ({ testId, jsonEntry }) { describe('${ testId }', () => { test.todo('is defined correctly', () => { expect(${ jsonEntry.accessor }).toBeTypeOf('object') - expect(Object.keys(${ jsonEntry.accessor }).length).not.toBe(0) + expect(Object.keys(${ jsonEntry.accessor })).not.toHaveLength(0) }) })\n` } @@ -61,16 +61,16 @@ function getFnTests (jsonEntry, json) { ? `// eslint-disable-next-line\n${ testIndent } ` : '' - return `test.todo('can be used in a component', () => { - const TestComponent = defineComponent({ - template: '', - setup () { - ${ lint }const result = ${ jsonEntry.accessor }(${ jsonEntry.params }) - return { result } - } - }) - - const wrapper = mount(TestComponent) + return `test.todo('can be used in a Vue Component', () => { + const wrapper = mount( + defineComponent({ + template: '', + setup () { + ${ lint }const result = ${ jsonEntry.accessor }(${ jsonEntry.params }) + return { result } + } + }) + ) // TODO: test the outcome expect(wrapper).toBeDefined() // this is here for lint only diff --git a/ui/testing/specs/generators/generator.generic.js b/ui/testing/specs/generators/generator.generic.js index 7d57d90fb23..aab73007889 100644 --- a/ui/testing/specs/generators/generator.generic.js +++ b/ui/testing/specs/generators/generator.generic.js @@ -26,7 +26,7 @@ function createVariableTest ({ testId, jsonEntry }) { describe('${ testId }', () => { test.todo('is defined correctly', () => { expect(${ jsonEntry.accessor }).toBeTypeOf('object') - expect(Object.keys(${ jsonEntry.accessor }).length).not.toBe(0) + expect(Object.keys(${ jsonEntry.accessor })).not.toHaveLength(0) }) })\n` } diff --git a/ui/testing/specs/specs.utils.js b/ui/testing/specs/specs.utils.js index 4fa4156b41b..c5b5012f44c 100644 --- a/ui/testing/specs/specs.utils.js +++ b/ui/testing/specs/specs.utils.js @@ -252,7 +252,7 @@ const typeMap = { valueRegex: /^undefined$/, createValue: () => 'undefined', createExpectCall: ({ ref }) => `expect(${ ref }).toBeUndefined()`, - expectMatcher: 'void 0' + expectMatcher: 'undefined' } }