Skip to content

Commit

Permalink
Merge pull request #5502 from mozilla/mntor-3925
Browse files Browse the repository at this point in the history
Add feature flag to conditionally show data broker removal attempts
  • Loading branch information
flozia authored Jan 14, 2025
2 parents 046e112 + d086c73 commit d18e111
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ export const DataBrokerRequestedRemoval: Story = {
args: {
exposureImg: FamilyTreeImage,
exposureData: ScanMockItemRequestedRemoval,
enabledFeatureFlags: ["AdditionalRemovalStatuses"],
enabledFeatureFlags: [
"AdditionalRemovalStatuses",
"DataBrokerRemovalAttempts",
],
},
};

Expand Down
18 changes: 17 additions & 1 deletion src/app/components/client/exposure_card/ExposureCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe("ScanResultCard", () => {
expect(innerDescription).toBeInTheDocument();
});

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

it("does not show an additional note for “requested removal” status label if the feature flag `DataBrokerRemovalAttempts` is not enabled", () => {
const ComposedProgressCard = composeStory(DataBrokerRequestedRemoval, Meta);
render(
<ComposedProgressCard
enabledFeatureFlags={["AdditionalRemovalStatuses"]}
/>,
);
const statusLabel = screen.getByText("Requested removal");
const statusLabelParent = statusLabel.parentElement as HTMLElement;
const labelNote = within(statusLabelParent).queryByText("Attempt", {
exact: false,
});

expect(labelNote).not.toBeInTheDocument();
});

it("hides the dt element if its dd counterpart has hideonmobile", () => {
const ComposedProgressCard = composeStory(DataBrokerInProgress, Meta);
render(<ComposedProgressCard />);
Expand Down
1 change: 1 addition & 0 deletions src/app/components/client/exposure_card/ScanResultCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export const ScanResultCard = (props: ScanResultCardProps) => {
const attemptCount = scanResult.optout_attempts ?? 0;
const statusPillNote =
props.enabledFeatureFlags?.includes("AdditionalRemovalStatuses") &&
props.enabledFeatureFlags?.includes("DataBrokerRemovalAttempts") &&
!scanResult.manually_resolved &&
scanResult.status === "waiting_for_verification" &&
attemptCount >= 1
Expand Down
1 change: 1 addition & 0 deletions src/db/tables/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const featureFlagNames = [
"LandingPageRedesign",
"EnableRemovalUnderMaintenanceStep",
"CirrusV2",
"DataBrokerRemovalAttempts",
] as const;
export type FeatureFlagName = (typeof featureFlagNames)[number];

Expand Down

0 comments on commit d18e111

Please sign in to comment.