mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
feat: Social page — aggregated post queues + X/video history (#345)
* feat(api): x/video post history endpoints Approved or rejected drafts vanished from both queues permanently -- the listers exclude terminal statuses and no history surface existed, so a posted tweet or video was only findable in the raw task list. GET /x/posts/history and GET /video/posts/history (CEO-gated, bounded) return acted-on drafts newest-first with the posted platform ids and reject reasons from the draft markers. Route tests assert by identity, not emptiness: approve/reject commits the whole session, so prior tests' rows legitimately persist in the shared test DB. * feat(panel): Social page aggregating post queues and history New dashboard page composing the X and video post queues with one unified history section beneath them -- both platforms interleaved newest-first, kind and outcome badges, posted X ids linking to the live tweet, reject reasons shown. The command center's two full queue cards become a compact pending-counts card linking to the page, so the queues have one home instead of duplicated surfaces. --------- Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
import { describe, it, expect, vi } from "vitest";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
|
||||
// Shallow-render the composition: mock every hook + child component so this
|
||||
// test only checks that the social summary card replaced the two full X/
|
||||
// video queues — each child's own behavior is covered by its own test file.
|
||||
vi.mock("@/hooks/use-dashboard", () => ({
|
||||
useCeoOverview: () => ({
|
||||
data: undefined,
|
||||
isLoading: false,
|
||||
isError: false,
|
||||
refetch: vi.fn(),
|
||||
}),
|
||||
useAuditorFlags: () => ({
|
||||
data: undefined,
|
||||
isLoading: false,
|
||||
isError: false,
|
||||
refetch: vi.fn(),
|
||||
}),
|
||||
useRecentActivity: () => ({
|
||||
data: undefined,
|
||||
isLoading: false,
|
||||
isError: false,
|
||||
refetch: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
vi.mock("@/hooks/use-tasks", () => ({
|
||||
useTasks: () => ({
|
||||
data: undefined,
|
||||
isLoading: false,
|
||||
isError: false,
|
||||
refetch: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock("../team-health-cards", () => ({
|
||||
TeamHealthCards: () => <div>TeamHealthCardsStub</div>,
|
||||
}));
|
||||
vi.mock("../key-metrics-panel", () => ({
|
||||
KeyMetricsPanel: () => <div>KeyMetricsPanelStub</div>,
|
||||
}));
|
||||
vi.mock("../auditor-alerts-panel", () => ({
|
||||
AuditorAlertsPanel: () => <div>AuditorAlertsPanelStub</div>,
|
||||
}));
|
||||
vi.mock("../active-blockers-panel", () => ({
|
||||
ActiveBlockersPanel: () => <div>ActiveBlockersPanelStub</div>,
|
||||
}));
|
||||
vi.mock("../recent-activity-feed", () => ({
|
||||
RecentActivityFeed: () => <div>RecentActivityFeedStub</div>,
|
||||
}));
|
||||
vi.mock("../quick-actions-bar", () => ({
|
||||
QuickActionsBar: () => <div>QuickActionsBarStub</div>,
|
||||
}));
|
||||
vi.mock("../ceo-approval-queue", () => ({
|
||||
CeoApprovalQueue: () => <div>CeoApprovalQueueStub</div>,
|
||||
}));
|
||||
vi.mock("../pr-review-queue", () => ({
|
||||
PrReviewQueue: () => <div>PrReviewQueueStub</div>,
|
||||
}));
|
||||
vi.mock("../release-proposal-card", () => ({
|
||||
ReleaseProposalCard: () => <div>ReleaseProposalCardStub</div>,
|
||||
}));
|
||||
vi.mock("../playbook-review-queue", () => ({
|
||||
PlaybookReviewQueue: () => <div>PlaybookReviewQueueStub</div>,
|
||||
}));
|
||||
vi.mock("../social-summary-card", () => ({
|
||||
SocialSummaryCard: () => <div>SocialSummaryCardStub</div>,
|
||||
}));
|
||||
vi.mock("../roadmap-review-queue", () => ({
|
||||
RoadmapReviewQueue: () => <div>RoadmapReviewQueueStub</div>,
|
||||
}));
|
||||
vi.mock("../strategy-signals-panel", () => ({
|
||||
StrategySignalsPanel: () => <div>StrategySignalsPanelStub</div>,
|
||||
}));
|
||||
vi.mock("../usage-overview-panel", () => ({
|
||||
UsageOverviewPanel: () => <div>UsageOverviewPanelStub</div>,
|
||||
}));
|
||||
vi.mock("../scorecard-overview-panel", () => ({
|
||||
ScorecardOverviewPanel: () => <div>ScorecardOverviewPanelStub</div>,
|
||||
}));
|
||||
|
||||
import { CommandCenter } from "../command-center";
|
||||
|
||||
describe("CommandCenter", () => {
|
||||
it("renders the social summary card instead of the full X/video queues", () => {
|
||||
render(<CommandCenter />);
|
||||
expect(screen.getByText("SocialSummaryCardStub")).toBeInTheDocument();
|
||||
expect(screen.queryByText("XPostQueueStub")).not.toBeInTheDocument();
|
||||
expect(screen.queryByText("VideoPostQueueStub")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user