From 4cd49f2cd83a915f8702309668317a1b3c28104f Mon Sep 17 00:00:00 2001 From: Luna McNulty Date: Tue, 5 Dec 2023 11:56:43 -0500 Subject: [PATCH 1/2] Test that adding tag results in an api request --- .../e2e/integration/apps/checklistsForm.cy.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/site/gatsby-site/cypress/e2e/integration/apps/checklistsForm.cy.js b/site/gatsby-site/cypress/e2e/integration/apps/checklistsForm.cy.js index 1875c438b9..18b68a8166 100644 --- a/site/gatsby-site/cypress/e2e/integration/apps/checklistsForm.cy.js +++ b/site/gatsby-site/cypress/e2e/integration/apps/checklistsForm.cy.js @@ -109,4 +109,22 @@ describe('Checklists App Form', () => { cy.wait(['@upsertChecklist']); }); }); + + maybeIt('Should trigger GraphQL upsert query on adding tag', () => { + withLogin(({ user }) => { + interceptFindChecklist({ ...defaultChecklist, owner_id: user.userId }); + interceptUpsertChecklist({}); + + cy.visit(url); + + cy.get('#tags_goals_input').type('Code Generation'); + cy.get('#tags_goals').contains('Code Generation').click(); + + cy.wait(['@upsertChecklist']).then((xhr) => { + expect(xhr.request.body.variables.checklist).to.deep.nested.include({ + tags_goals: ['GMF:Known AI Goal:Code Generation'], + }); + }); + }); + }); }); From 571fa240d39399325df058a3d8c08f57f299e4be Mon Sep 17 00:00:00 2001 From: Luna McNulty Date: Mon, 18 Dec 2023 23:20:37 -0500 Subject: [PATCH 2/2] Add uncomitted id to input --- site/gatsby-site/src/components/checklists/CheckListForm.js | 1 + 1 file changed, 1 insertion(+) diff --git a/site/gatsby-site/src/components/checklists/CheckListForm.js b/site/gatsby-site/src/components/checklists/CheckListForm.js index 554ecda6ba..8fb362a9fc 100644 --- a/site/gatsby-site/src/components/checklists/CheckListForm.js +++ b/site/gatsby-site/src/components/checklists/CheckListForm.js @@ -257,6 +257,7 @@ const QueryTagInput = ({ include(tag.split(':')))} onChange={(value) => {