Skip to content

Commit 02849a4

Browse files
committed
fix: add data-qa attributes for better tracking in ServiceTiles, SuggestedCampaigns, Plans, and ModulesBottomNavigation components
1 parent ec0baf4 commit 02849a4

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

src/common/components/ServiceTiles/index.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ const ServiceTiles = ({ onClick, promoTemplates }: ServiceTilesProps) => {
2828
role="list"
2929
title="promo-templates"
3030
>
31-
{promoTemplates.map((template) => {
31+
{promoTemplates.map((template, i) => {
3232
if (!template.strapi) return null;
3333
const { title, price, tags, image, background, pre_title } =
3434
template.strapi;
3535
const outputs = tags.map((output) => {
3636
const { text, icon } = output;
3737
return (
3838
<AdditionalInfoTag
39-
key={text}
39+
key={text.toLowerCase().replace(/\s+/g, '_')}
4040
color={appTheme.palette.grey[700]}
4141
hue="#ffff"
4242
isPill
@@ -53,7 +53,12 @@ const ServiceTiles = ({ onClick, promoTemplates }: ServiceTilesProps) => {
5353
};
5454

5555
return (
56-
<ScrollingGrid.Item key={template.id} role="listitem" title={title}>
56+
<ScrollingGrid.Item
57+
key={template.id}
58+
role="listitem"
59+
title={title}
60+
data-qa={`service-tile-${i}`}
61+
>
5762
<ServiceTile
5863
title={title}
5964
description={pre_title}

src/pages/Dashboard/SuggestedCampaigns.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ export const SuggestedCampaigns = () => {
4343
</Row>
4444
<ScrollingGrid id="suggested-campaigns-scrolling-grid">
4545
{!!items.plans.length &&
46-
items.plans.map((plan) => (
47-
<ScrollingGrid.Item key={`suggested_plan_${plan.id}`}>
46+
items.plans.map((plan, i) => (
47+
<ScrollingGrid.Item
48+
key={`suggested_plan_${plan.id}`}
49+
data-qa={`tracked-activity-${i}`}
50+
>
4851
<PlanCard
4952
status={getPlanStatus(plan, t).status}
5053
i18n={{

src/pages/Dashboard/project-items/Plans.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,15 @@ export const Plans = ({ projectId }: { projectId: number }) => {
5656
</Row>
5757
<Separator style={{ margin: `${appTheme.space.md} 0` }} />
5858
<Row>
59-
{plans.map((plan) => (
60-
<Col size={4} xs={12} md={6} lg={4}>
59+
{plans.map((plan, i) => (
60+
<Col
61+
size={4}
62+
xs={12}
63+
md={6}
64+
lg={4}
65+
key={`project_plan_${plan.id}`}
66+
data-qa={`setup-activity-${i}`}
67+
>
6168
<PlanCard
6269
status={getPlanStatus(plan, t).status}
6370
i18n={{

src/pages/Plan/common/ModulesBottomNavigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const ModulesBottomNavigation = () => {
7272
<Button
7373
isBasic
7474
size="small"
75-
data-qa={`modules-bottom-navigation-${nextTab}`}
75+
data-qa={`modules-bottom-navigation-${nextTab.name}`}
7676
onClick={() => {
7777
setActiveTab(nextTab);
7878
if (main) {

0 commit comments

Comments
 (0)