rofrischmann/fela

View on GitHub
packages/fela-utils/src/__tests__/isNestedSelector-test.js

Summary

Maintainability
A
1 hr
Test Coverage
import isNestedSelector from '../isNestedSelector'

describe('Validating nested selectors', () => {
  it('should return true', () => {
    expect(isNestedSelector(':hover')).toEqual(true)
    expect(isNestedSelector('[foo="true"]')).toEqual(true)
    expect(isNestedSelector('> div')).toEqual(true)
    expect(isNestedSelector('& .foo')).toEqual(true)
    expect(isNestedSelector('& ~ #id')).toEqual(true)
  })

  it('should return false', () => {
    expect(isNestedSelector('.foo')).toEqual(false)
    expect(isNestedSelector(' .foo')).toEqual(false)
    expect(isNestedSelector('~ #id')).toEqual(false)
  })
})