Skip to content

Commit

Permalink
fix: send POST body to indicators/expression/description as text plain (
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Nov 16, 2022
1 parent c647b6d commit 82d26d4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
isAddOrUpdateSystemOrUserSetting,
addOrUpdateConfigurationProperty,
isMetadataPackageInstallation,
isExpressionDescriptionValidation,
} from './textPlainMatchers'

describe('isReplyToMessageConversation', () => {
Expand Down Expand Up @@ -241,3 +242,20 @@ describe('isMetadataPackageInstallation', () => {
).toBe(false)
})
})

describe('isExpressionDescriptionValidation', () => {
it('returns true for a POST to "indicators/expression/description"', () => {
expect(
isExpressionDescriptionValidation('create', {
resource: 'indicators/expression/description',
})
).toBe(true)
})
it('retuns false for a POST to a different resource', () => {
expect(
isMetadataPackageInstallation('create', {
resource: 'indicators/expression/somethingelse',
})
).toBe(false)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,10 @@ export const isMetadataPackageInstallation = (
type: FetchType,
{ resource }: ResolvedResourceQuery
): boolean => type === 'create' && resource === 'synchronization/metadataPull'

// POST to 'indicaators/expression/description' (validate an expression)
export const isExpressionDescriptionValidation = (
type: FetchType,
{ resource }: ResolvedResourceQuery
): boolean =>
type === 'create' && resource === 'indicators/expression/description'

0 comments on commit 82d26d4

Please sign in to comment.