File size: 496 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { getSegmentValue } from './reducers/get-segment-value'

describe('getSegmentValue', () => {
  it('should support string segment', () => {
    expect(getSegmentValue('foo')).toEqual('foo')
  })

  it('should support dynamic segment', () => {
    expect(getSegmentValue(['slug', 'hello-world', 'd'])).toEqual('hello-world')
  })

  it('should support catch all segment', () => {
    expect(getSegmentValue(['slug', 'blog/hello-world', 'c'])).toEqual(
      'blog/hello-world'
    )
  })
})