mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
import { stringMatchesSomePattern } from '@sentry/core'
|
|
import { useAppConfig } from '#imports'
|
|
import { AUTHOR_CODE_SENTRY_DENY_URLS } from '@baserow/modules/builder/constants'
|
|
|
|
describe('AUTHOR_CODE_SENTRY_DENY_URLS', () => {
|
|
test('the builder module hands them to the Sentry config', () => {
|
|
expect(useAppConfig().sentry.config.denyUrls).toEqual(
|
|
expect.arrayContaining(AUTHOR_CODE_SENTRY_DENY_URLS)
|
|
)
|
|
})
|
|
|
|
test.each([
|
|
'https://api.baserow.io/api/builder/preview/618528/custom-code/js/',
|
|
'https://api.baserow.io/api/custom_code/618528/js/public/',
|
|
'http://localhost:8000/api/builder/preview/42/custom-code/js/',
|
|
])('matches the custom JavaScript served at %s', (url) => {
|
|
expect(stringMatchesSomePattern(url, AUTHOR_CODE_SENTRY_DENY_URLS)).toBe(
|
|
true
|
|
)
|
|
})
|
|
|
|
test.each([
|
|
'https://preview.baserow.io/_nuxt/entry.BYb6vRfj.js',
|
|
'https://baserow.io/_nuxt/builder.C3e1kPn2.js',
|
|
'https://api.baserow.io/api/builder/domains/published/page/12/dispatch/',
|
|
'https://preview.baserow.io/builder/preview/618528/submit',
|
|
])('does not match %s', (url) => {
|
|
expect(stringMatchesSomePattern(url, AUTHOR_CODE_SENTRY_DENY_URLS)).toBe(
|
|
false
|
|
)
|
|
})
|
|
})
|