|
|
|
@ -37,7 +37,13 @@ module.exports = { |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
describe('Selectors', () => { |
|
|
|
|
|
|
|
describe.only('Selectors', () => { |
|
|
|
var obj; |
|
|
|
|
|
|
|
beforeEach(() => { |
|
|
|
obj = new Selectors(); |
|
|
|
}); |
|
|
|
|
|
|
|
it('Creates collection item correctly', () => { |
|
|
|
var c = new Selectors(); |
|
|
|
@ -45,6 +51,21 @@ module.exports = { |
|
|
|
expect(m instanceof Selector).toEqual(true); |
|
|
|
}); |
|
|
|
|
|
|
|
it('getFullString with single class', () => { |
|
|
|
obj.add({name: 'test'}); |
|
|
|
expect(obj.getFullString()).toEqual('.test'); |
|
|
|
}); |
|
|
|
|
|
|
|
it('getFullString with multiple classes', () => { |
|
|
|
obj.add([{name: 'test'}, {name: 'test2'}]); |
|
|
|
expect(obj.getFullString()).toEqual('.test.test2'); |
|
|
|
}); |
|
|
|
|
|
|
|
it('getFullString with mixed selectors', () => { |
|
|
|
obj.add([{name: 'test'}, {name: 'test2', type: Selector.TYPE_ID}]); |
|
|
|
expect(obj.getFullString()).toEqual('.test#test2'); |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|