mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-18 20:50:33 +03:00
fix: afterNavigation logic (its never set in options)
This commit is contained in:
committed by
Alexander Lichter
parent
419951c59f
commit
4a8f9753e0
@@ -6,8 +6,6 @@ import setOptions from '../../src/shared/options'
|
||||
import { hasGlobalWindowFn } from '../../src/shared/window'
|
||||
import { defaultOptions } from '../../src/shared/constants'
|
||||
|
||||
const noop = () => {}
|
||||
|
||||
describe('shared', () => {
|
||||
test('ensureIsArray ensures var is array', () => {
|
||||
let a = { p: 1 }
|
||||
@@ -38,27 +36,4 @@ describe('shared', () => {
|
||||
expect(options.contentKeyName).toBeDefined()
|
||||
expect(options.contentKeyName).toBe(defaultOptions.contentKeyName)
|
||||
})
|
||||
|
||||
test('setOptions warns when afterNavigation not fn', () => {
|
||||
const warn = jest.spyOn(console, 'warn').mockImplementation(noop)
|
||||
|
||||
let options = { afterNavigation: true }
|
||||
options = setOptions(options)
|
||||
|
||||
expect(warn).toHaveBeenCalledTimes(1)
|
||||
expect(options.afterNavigation).toBeUndefined()
|
||||
|
||||
warn.mockRestore()
|
||||
})
|
||||
test('setOptions sets refreshOnceOnNavigation when afterNavigation defined', () => {
|
||||
const warn = jest.spyOn(console, 'warn').mockImplementation(noop)
|
||||
|
||||
let options = { afterNavigation: noop }
|
||||
options = setOptions(options)
|
||||
|
||||
expect(warn).not.toHaveBeenCalled()
|
||||
expect(options.refreshOnceOnNavigation).toBe(true)
|
||||
|
||||
warn.mockRestore()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user