Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,30 @@ describe(resolvePageArguments, () => {
expect(cb).toEqual(undefined)
})

it('should accept ("name")', () => {
const [category, name, properties, options, cb] =
resolvePageArguments('name')

expect(name).toEqual('name')
expect(category).toEqual(null)
expect(properties).toEqual({})
expect(options).toEqual({})
expect(cb).toEqual(undefined)
})

it('should accept ("", "name")', () => {
const [category, name, properties, options, cb] = resolvePageArguments(
'',
'name'
)

expect(name).toEqual('name')
expect(category).toEqual('')
expect(properties).toEqual({})
expect(options).toEqual({})
expect(cb).toEqual(undefined)
})

it('should accept (category, name, properties, options, cb)', () => {
const fn = jest.fn()
const [category, name, properties, options, cb] = resolvePageArguments(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test('Segment events', async ({ page }) => {
analytics.group('foo', { hello: 'world' })
analytics.alias('john', 'johnsmith')
analytics.track('a track call', {foo: 'bar'})
analytics.page('Retail Page', 'Home', { url: 'http://my-home.com', title: 'Some Title' });
analytics.page('Home', 'Retail Page', { url: 'http://my-home.com', title: 'Some Title' });
}
}`

Expand Down
Loading