Skip to content

Commit

Permalink
more config testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kremalicious committed Feb 15, 2020
1 parent f5a0180 commit 467a13b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/__tests__/gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,30 @@ describe('gatsby-plugin-google-analytics', () => {
const result = JSON.stringify(setPostBodyComponents.mock.calls[0][0])
expect(result).toMatch(/TEST_SITE_URL/)
})

it('sets requireConsent', () => {
const { setPostBodyComponents } = setup({
requireConsent: true
})
const result = JSON.stringify(setPostBodyComponents.mock.calls[0][0])
expect(result).toMatch(/requireConsent/)
})

it('sets disableCookies', () => {
const { setPostBodyComponents } = setup({
disableCookies: true
})
const result = JSON.stringify(setPostBodyComponents.mock.calls[0][0])
expect(result).toMatch(/disableCookies/)
})

it('sets localScript', () => {
const { setPostBodyComponents } = setup({
localScript: 'TEST_LOCAL_SCRIPT'
})
const result = JSON.stringify(setPostBodyComponents.mock.calls[0][0])
expect(result).toMatch(/TEST_LOCAL_SCRIPT/)
})
})
})
})
Expand Down

0 comments on commit 467a13b

Please sign in to comment.