From 508a1217ec5a311be864cf68dac15812b05ad550 Mon Sep 17 00:00:00 2001 From: Victor Nyagudi Date: Tue, 7 Jan 2025 08:20:29 +0000 Subject: [PATCH] Add test case for DM list scrolling behavior --- .../channels/messaging/MM-Pending.md | 44 +++++++++++++++++++ src/util/helper.ts | 2 +- src/util/markdown.ts | 2 +- src/util/types.ts | 2 +- src/util/zephyr.ts | 6 +-- 5 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 data/test-cases/channels/messaging/MM-Pending.md diff --git a/data/test-cases/channels/messaging/MM-Pending.md b/data/test-cases/channels/messaging/MM-Pending.md new file mode 100644 index 000000000..055b0ea31 --- /dev/null +++ b/data/test-cases/channels/messaging/MM-Pending.md @@ -0,0 +1,44 @@ +--- +# (Required) Ensure all values are filled up +name: "Navigating DM list using Up/Down arrow keys scrolls it" +status: Active +priority: Normal +folder: Messaging +authors: "@Victor-Nyagudi" +team_ownership: [] +priority_p1_to_p4: P2 - Core Functions (Do core functions work?) + +# (Optional) +location: Messaging +component: null +tags: [] +labels: [] +tested_by_contributor: '' + +# (Optional) Test type and tools +cypress: in Production +detox: N/A +mmctl: N/A +playwright: N/A +rainforest: [] +manual_test_environments: [] + +# Do not change +id: null +key: null +created_on: null +last_updated: null +case_hashed: null +steps_hashed: null +--- + +**Step 1** + +1. Click the "+" next to the "Direct Messages" category header in the LHS to open the DM list modal. +2. Ensure there are enough list items such that you'll need to scroll to see the rest. +3. Press the down arrow key to navigate through items to an item out of view. +4. Press the up arrow key to navigate back up to an item out of view. + +**Expected** + +The DM list scrolls to reveal the hidden items in step 3 and 4. diff --git a/src/util/helper.ts b/src/util/helper.ts index d9d39e846..1d9aeaf9e 100644 --- a/src/util/helper.ts +++ b/src/util/helper.ts @@ -183,7 +183,7 @@ function reorganizeTestCaseFields(testCase: TestCase) { objective: testCase.objective, precondition: testCase.precondition, estimatedTime: testCase.estimatedTime, - labels:testCase.labels, + labels: testCase.labels, componentName: testCase.componentName, priorityName: testCase.priorityName, statusName: testCase.statusName, diff --git a/src/util/markdown.ts b/src/util/markdown.ts index fd0a2566f..94cf54963 100644 --- a/src/util/markdown.ts +++ b/src/util/markdown.ts @@ -321,7 +321,7 @@ export function markdownToTestCase(file: string): TestCase { objective: objective, precondition: precondition, estimatedTime: null, - labels:data.labels, + labels: data.labels, componentName: data.component, priorityName: data.priority, statusName: data.status, diff --git a/src/util/types.ts b/src/util/types.ts index 1797ff111..ef5acad40 100644 --- a/src/util/types.ts +++ b/src/util/types.ts @@ -27,7 +27,7 @@ export type TestCase = { objective: string | null; precondition: string | null; estimatedTime?: number | null; - labels:string[]; + labels: string[]; component?: Component | null; componentName?: string | null; priority?: Priority; diff --git a/src/util/zephyr.ts b/src/util/zephyr.ts index c8984111c..9abf37356 100644 --- a/src/util/zephyr.ts +++ b/src/util/zephyr.ts @@ -63,7 +63,7 @@ export class ZephyrClient { priorityName: testCase.priorityName, statusName: testCase.statusName, folderId: testCase.folder?.id, - labels:testCase.labels, + labels: testCase.labels, customFields: { ...testCase.customFields, 'Last Updated': formatDate(new Date(), datetimeFormat), @@ -111,7 +111,7 @@ export class ZephyrClient { objective: testCase.objective, precondition: testCase.precondition, estimatedTime: testCase.estimatedTime, - labels:testCase.labels, + labels: testCase.labels, component: testCase.component, priority: { id: testCase.priority.id }, status: { id: testCase.status.id }, @@ -580,7 +580,7 @@ export type TestCaseUpdate = { objective?: string | null; precondition?: string | null; estimatedTime?: number | null; - labels:string[]; + labels: string[]; component?: { id: number } | null; priority: { id: number }; status: { id: number };