diff --git a/opencti-platform/opencti-graphql/tests/02-integration/02-resolvers/indicator-test.ts b/opencti-platform/opencti-graphql/tests/02-integration/02-resolvers/indicator-test.ts index bdfe27de4535..5beb38f24b5a 100644 --- a/opencti-platform/opencti-graphql/tests/02-integration/02-resolvers/indicator-test.ts +++ b/opencti-platform/opencti-graphql/tests/02-integration/02-resolvers/indicator-test.ts @@ -246,6 +246,22 @@ describe('Indicator resolver standard behavior', () => { }); expect(queryResult.data?.indicatorContextClean.id).toEqual(firstIndicatorInternalId); }); + it('should update indicator observables values on pattern edit', async () => { + const UPDATE_QUERY = gql` + mutation IndicatorFieldPatch($id: ID!, $input: [EditInput!]!) { + indicatorFieldPatch(id: $id, input: $input) { + id + name + } + } + `; + const queryResult = await queryAsAdminWithSuccess({ + query: UPDATE_QUERY, + variables: { id: firstIndicatorInternalId, input: { key: 'pattern', value: ['[domain-name:value = \'www.payah.test\']'] } }, + }); + console.log('firstIndicatorInternalId : ', firstIndicatorInternalId); + console.log('queryResult.data?.indicatorFieldPatch : ', queryResult.data?.indicatorFieldPatch); + }); it('should add relation in indicator', async () => { const RELATION_ADD_QUERY = gql` mutation IndicatorRelationAdd($id: ID!, $input: StixRefRelationshipAddInput!) { diff --git a/opencti-platform/opencti-graphql/tests/03-streams/00-Raw/raw-test.js b/opencti-platform/opencti-graphql/tests/03-streams/00-Raw/raw-test.js index c63d54fd7430..d2fa5c54355b 100644 --- a/opencti-platform/opencti-graphql/tests/03-streams/00-Raw/raw-test.js +++ b/opencti-platform/opencti-graphql/tests/03-streams/00-Raw/raw-test.js @@ -70,7 +70,7 @@ describe('Raw streams tests', () => { expect(updateEventsByTypes['external-reference'].length).toBe(1); expect(updateEventsByTypes['grouping'].length).toBe(3); expect(updateEventsByTypes['incident'].length).toBe(3); - expect(updateEventsByTypes['indicator'].length).toBe(4); + expect(updateEventsByTypes['indicator'].length).toBe(5); expect(updateEventsByTypes['label'].length).toBe(1); expect(updateEventsByTypes['malware-analysis'].length).toBe(3); expect(updateEventsByTypes['note'].length).toBe(3); @@ -82,7 +82,7 @@ describe('Raw streams tests', () => { expect(updateEventsByTypes['threat-actor'].length).toBe(17); expect(updateEventsByTypes['vocabulary'].length).toBe(3); expect(updateEventsByTypes['vulnerability'].length).toBe(3); - expect(updateEvents.length).toBe(163); + expect(updateEvents.length).toBe(164); for (let updateIndex = 0; updateIndex < updateEvents.length; updateIndex += 1) { const event = updateEvents[updateIndex]; const { data: insideData, origin, type } = event; diff --git a/opencti-platform/opencti-graphql/tests/utils/testQuery.ts b/opencti-platform/opencti-graphql/tests/utils/testQuery.ts index 5996e215dd87..d4fc8b55473a 100644 --- a/opencti-platform/opencti-graphql/tests/utils/testQuery.ts +++ b/opencti-platform/opencti-graphql/tests/utils/testQuery.ts @@ -22,7 +22,7 @@ export const SYNC_LIVE_START_REMOTE_URI = conf.get('app:sync_live_start_remote_u export const SYNC_DIRECT_START_REMOTE_URI = conf.get('app:sync_direct_start_remote_uri'); export const SYNC_RESTORE_START_REMOTE_URI = conf.get('app:sync_restore_start_remote_uri'); export const SYNC_TEST_REMOTE_URI = `http://api-tests:${PORT}`; -export const RAW_EVENTS_SIZE = 1090; +export const RAW_EVENTS_SIZE = 1091; export const SYNC_LIVE_EVENTS_SIZE = 608; export const PYTHON_PATH = './src/python/testing';