Add verification questions, claim flow and scam warnings
- post form: up to 3 verification questions (loss and found) and a "how not to get scammed" note; sent as verificationQuestions JSON - feed card: "I found it" / "It's mine" instead of "Write" for posts with questions; phone shows "after check" until the author approves - chat draft shows ClaimForm; VerificationPanel lets the author approve or reject answers and locks the claimant's input until approval, then offers the author's phone - messages: claim answers card, verification system line, fraudSignal warnings for the recipient; ChatSafetyNotice with new-account mark - tests, README Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -69,3 +69,27 @@ test("своё объявление в ленте: номер открывает
|
||||
fireEvent.click(screen.getByText(SHOW));
|
||||
expect(await screen.findByText("+7 (999) 111-22-33")).toBeTruthy();
|
||||
});
|
||||
|
||||
test("находка с контрольными вопросами: вместо номера — «после проверки», кнопка «Это моё»", () => {
|
||||
useAuthContext.mockReturnValue({ isAuthenticated: true, user: { id: 5 } });
|
||||
render(<PostOnFeed ad={{ ...AD, type: "found", phoneVisible: true, verificationQuestions: ["Что на брелке?"] }} />);
|
||||
|
||||
expect(screen.queryByText(SHOW)).toBeNull();
|
||||
expect(screen.getByText(/Номер — после проверки|Number after check/)).toBeTruthy();
|
||||
expect(screen.getByText(/^(Это моё|It's mine)$/)).toBeTruthy();
|
||||
});
|
||||
|
||||
test("потеря с вопросами: нашедший пишет через «Я нашёл», номер — после проверки", () => {
|
||||
useAuthContext.mockReturnValue({ isAuthenticated: true, user: { id: 5 } });
|
||||
render(<PostOnFeed ad={{ ...AD, phoneVisible: true, verificationQuestions: ["Что выгравировано?"] }} />);
|
||||
|
||||
expect(screen.queryByText(SHOW)).toBeNull();
|
||||
expect(screen.getByText(/^(Я нашёл|I found it)$/)).toBeTruthy();
|
||||
});
|
||||
|
||||
test("автор своей находки с вопросами открывает номер как обычно", () => {
|
||||
useAuthContext.mockReturnValue({ isAuthenticated: true, user: { id: 2 } });
|
||||
render(<PostOnFeed ad={{ ...AD, type: "found", phoneVisible: true, verificationQuestions: ["Что на брелке?"] }} />);
|
||||
|
||||
expect(screen.getByText(SHOW)).toBeTruthy();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user