Sha256: a1408ffe51589841d8af04db4dd6b6ac9035389b0464b9df2b265274b95671e7
Contents?: true
Size: 1.16 KB
Versions: 11
Compression:
Stored size: 1.16 KB
Contents
import { mockFactory } from '../../../../testHelper'; import updateOvalPolicyMutation from '../../../../graphql/mutations/updateOvalPolicy.gql'; import { ovalPolicy } from './OvalPoliciesShow.fixtures'; const updateOvalPolicyMockFactory = mockFactory( 'updateOvalPolicy', updateOvalPolicyMutation ); export const updatedName = 'updated policy name'; const variables = { id: ovalPolicy.id, name: updatedName, cronLine: ovalPolicy.cronLine, description: ovalPolicy.description, }; const responsePolicy = { ovalPolicy: { __typename: 'ForemanOpenscap::OvalPolicy', id: ovalPolicy.id, name: updatedName, description: ovalPolicy.description, cronLine: ovalPolicy.cronLine, }, errors: [], }; export const policyUpdateMock = updateOvalPolicyMockFactory( variables, responsePolicy ); export const policyUpdateErrorMock = updateOvalPolicyMockFactory( variables, responsePolicy, { errors: [{ message: 'This is an unexpected failure.' }] } ); export const policyUpdateValidationMock = updateOvalPolicyMockFactory( variables, { ovalPolicy, errors: [ { path: ['attributes', 'name'], message: 'has already been taken' }, ], } );
Version data entries
11 entries across 11 versions & 1 rubygems