---
# System prepended metadata

title: 'Finishing nomination sending flow - Mon, Tues 30th Nov-1st Dec, 2020'
tags: [C+, programmingjournal, mocks, '2020', nominations]

---

# Finishing nomination sending flow - Mon, Tues 30th Nov-1st Dec, 2020

Finishing up the "happy flow" for sending nominations from C+. This is our v2 goal for the app.

I've done the whole thing with mocks, including the mutation, which is cool:

```typescript=
export const RNomination_CreateNominationPayloadMock = Factory.Sync.makeFactory<RNomination_CreateNominationPayload>({
    errors: [],
    success: true,
    message: Factory.each(() => faker.lorem.sentence()),
    nomination: SrwFeed_FeedItemMock.build({ subjectType: 'rrnomination' }),
})


const nominationQuestion: RNomination_CustomQuestionInput[] = [
    { name: nominationForm[0].id, answer: [nominationForm[0].options[0].value] },
]

export const nominationsMutation: MockedResponse<CreateNominationMutation> = {
    request: {
        query: CREATE_NOMINATION,
        variables: {
            input: {
               // ...
            },
        } as MutationSrwCreateNominationArgs,
    },
    result: {
        data: {
            srwCreateNomination: RNomination_CreateNominationPayloadMock.build(),
        },
    },
    delay: 1000,
}
```

Otherwise, fairly standard. Now I need to refactor a user search component to make it reusable in another place in the sending flow that needs to do something similar.

###### tags: `programmingjournal` `2020` `C+` `nominations` `mocks`