Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip #8610

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

wip #8610

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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!) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion opencti-platform/opencti-graphql/tests/utils/testQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down