mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-12 18:26:36 +08:00
feat(waf): 新增安全防护节点 security_check
基础特征检测九项可开关;默认开启路径穿越与文件包含;命中任意规则走 false。
This commit is contained in:
@@ -25,7 +25,9 @@ it('hides match and block until UA check is enabled', () => {
|
||||
const { rerender } = render(
|
||||
<NodeProperties node={node} ipGroups={[]} onChange={onChange} />,
|
||||
);
|
||||
expect(screen.queryByRole('switch', { name: /屏蔽常见爬虫/ })).not.toBeInTheDocument();
|
||||
expect(
|
||||
screen.queryByRole('switch', { name: /屏蔽常见爬虫/ }),
|
||||
).not.toBeInTheDocument();
|
||||
expect(screen.queryByLabelText('浏览器')).not.toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('switch', { name: /开启 UA 检查/ }));
|
||||
expect(onChange).toHaveBeenCalledWith(
|
||||
@@ -40,9 +42,15 @@ it('hides match and block until UA check is enabled', () => {
|
||||
onChange={onChange}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByRole('switch', { name: /屏蔽常见爬虫/ })).toBeInTheDocument();
|
||||
expect(screen.getByRole('switch', { name: /屏蔽非正常/ })).toBeInTheDocument();
|
||||
expect(screen.getByRole('switch', { name: /屏蔽自定义/ })).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole('switch', { name: /屏蔽常见爬虫/ }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole('switch', { name: /屏蔽非正常/ }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole('switch', { name: /屏蔽自定义/ }),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getAllByLabelText('说明').length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user