Skip to content

Commit d18e111

Browse files
authored
Merge pull request #5502 from mozilla/mntor-3925
Add feature flag to conditionally show data broker removal attempts
2 parents 046e112 + d086c73 commit d18e111

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

src/app/components/client/exposure_card/ExposureCard.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ export const DataBrokerRequestedRemoval: Story = {
8787
args: {
8888
exposureImg: FamilyTreeImage,
8989
exposureData: ScanMockItemRequestedRemoval,
90-
enabledFeatureFlags: ["AdditionalRemovalStatuses"],
90+
enabledFeatureFlags: [
91+
"AdditionalRemovalStatuses",
92+
"DataBrokerRemovalAttempts",
93+
],
9194
},
9295
};
9396

src/app/components/client/exposure_card/ExposureCard.test.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ describe("ScanResultCard", () => {
150150
expect(innerDescription).toBeInTheDocument();
151151
});
152152

153-
it("shows an additional note for “requested removal” status label", () => {
153+
it("shows an additional note for “requested removal” status label if the feature flag `DataBrokerRemovalAttempts` is enabled", () => {
154154
const ComposedProgressCard = composeStory(DataBrokerRequestedRemoval, Meta);
155155
render(<ComposedProgressCard />);
156156
const statusLabel = screen.getByText("Requested removal");
@@ -162,6 +162,22 @@ describe("ScanResultCard", () => {
162162
expect(labelNote).toBeInTheDocument();
163163
});
164164

165+
it("does not show an additional note for “requested removal” status label if the feature flag `DataBrokerRemovalAttempts` is not enabled", () => {
166+
const ComposedProgressCard = composeStory(DataBrokerRequestedRemoval, Meta);
167+
render(
168+
<ComposedProgressCard
169+
enabledFeatureFlags={["AdditionalRemovalStatuses"]}
170+
/>,
171+
);
172+
const statusLabel = screen.getByText("Requested removal");
173+
const statusLabelParent = statusLabel.parentElement as HTMLElement;
174+
const labelNote = within(statusLabelParent).queryByText("Attempt", {
175+
exact: false,
176+
});
177+
178+
expect(labelNote).not.toBeInTheDocument();
179+
});
180+
165181
it("hides the dt element if its dd counterpart has hideonmobile", () => {
166182
const ComposedProgressCard = composeStory(DataBrokerInProgress, Meta);
167183
render(<ComposedProgressCard />);

src/app/components/client/exposure_card/ScanResultCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ export const ScanResultCard = (props: ScanResultCardProps) => {
217217
const attemptCount = scanResult.optout_attempts ?? 0;
218218
const statusPillNote =
219219
props.enabledFeatureFlags?.includes("AdditionalRemovalStatuses") &&
220+
props.enabledFeatureFlags?.includes("DataBrokerRemovalAttempts") &&
220221
!scanResult.manually_resolved &&
221222
scanResult.status === "waiting_for_verification" &&
222223
attemptCount >= 1

src/db/tables/featureFlags.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const featureFlagNames = [
5757
"LandingPageRedesign",
5858
"EnableRemovalUnderMaintenanceStep",
5959
"CirrusV2",
60+
"DataBrokerRemovalAttempts",
6061
] as const;
6162
export type FeatureFlagName = (typeof featureFlagNames)[number];
6263

0 commit comments

Comments
 (0)