Skip to content

Commit 67d45ab

Browse files
thegdsksglinr
andcommitted
fix: allowlist new components in security audit, fix flaky date test
Add smart-announcement.tsx and next/index.ts to dangerouslySetInnerHTML allowlist (JSON script injection and feature description rendering). Fix relative date test to also match "last week" and "last month". Co-Authored-By: Glinr <bot@glincker.com>
1 parent 7c1f94a commit 67d45ab

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

scripts/security-audit.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ const RULES = [
3636
/^src\/react\/components\/banner\.tsx$/,
3737
/^src\/react\/components\/changelog-page\.tsx$/,
3838
/^src\/react\/components\/changelog-widget\.tsx$/,
39+
/^src\/react\/components\/smart-announcement\.tsx$/,
3940
/^src\/react\/components\/spotlight\.tsx$/,
4041
/^src\/react\/components\/toast\.tsx$/,
42+
/^src\/next\/index\.ts$/,
4143
],
4244
},
4345
];

src/__tests__/react-components.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe("ChangelogWidget", () => {
129129
</Wrapper>,
130130
);
131131
await userEvent.click(screen.getByText("What's New"));
132-
expect(screen.getAllByText(/ago|yesterday|today/i).length).toBeGreaterThan(0);
132+
expect(screen.getAllByText(/ago|yesterday|today|last week|last month/i).length).toBeGreaterThan(0);
133133
});
134134

135135
it("disables widget enter animation when preset is none", async () => {

0 commit comments

Comments
 (0)