2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-19 09:50:33 +03:00

eslint fixes

This commit is contained in:
Jeff Sagal
2021-08-01 12:32:22 -07:00
parent 8588cac3d7
commit 3bbc309422
87 changed files with 3236 additions and 2864 deletions
+19 -18
View File
@@ -1,31 +1,32 @@
import Select from '../../src/components/Select';
import Select from '../../src/components/Select'
describe('Comparing Options', () => {
const comparator = Select.methods.optionComparator.bind({
getOptionKey: Select.props.getOptionKey.default,
});
})
it('can compare numbers', () => {
expect(comparator(1, 2)).toBeFalsy();
expect(comparator(1, 1)).toBeTruthy();
});
expect(comparator(1, 2)).toBeFalsy()
expect(comparator(1, 1)).toBeTruthy()
})
it('can compare strings', () => {
expect(comparator('one', 'one')).toBeTruthy();
expect(comparator('one', 'two')).toBeFalsy();
});
expect(comparator('one', 'one')).toBeTruthy()
expect(comparator('one', 'two')).toBeFalsy()
})
it('can compare objects', () => {
// compare ID keys
expect(comparator({label: 'halo', id: 1}, {label: 'halo', id: 2}))
.toBeFalsy();
expect(
comparator({ label: 'halo', id: 1 }, { label: 'halo', id: 2 })
).toBeFalsy()
// compare objects
expect(comparator({label: 'halo', value: 1}, {label: 'halo', value: 1}))
.toBeTruthy();
expect(
comparator({ label: 'halo', value: 1 }, { label: 'halo', value: 1 })
).toBeTruthy()
// compare objects with different orders
expect(comparator({value: 1, label: 'halo'}, {label: 'halo', value: 1}))
.toBeTruthy();
});
});
expect(
comparator({ value: 1, label: 'halo' }, { label: 'halo', value: 1 })
).toBeTruthy()
})
})