feedbackBaseServiceBoundary.test.ts 1.0 KB

1234567891011121314151617181920212223242526272829
  1. import { readFileSync } from "node:fs";
  2. import { describe, expect, it } from "vitest";
  3. function readSource(path: string): string {
  4. return readFileSync(path, "utf8");
  5. }
  6. describe("feedback base service boundary", () => {
  7. it("keeps feedback on the base service when workspace services are disconnected", () => {
  8. const rootSource = readSource("packages/ui/src/Root.tsx");
  9. const rootWorkspaceContentSource = readSource(
  10. "packages/ui/src/root/RootWorkspaceContent.tsx",
  11. );
  12. const appSource = readSource("packages/ui/src/App.tsx");
  13. expect(rootSource).toContain(
  14. "baseFeedbackService={services.feedbackService}",
  15. );
  16. expect(rootWorkspaceContentSource).toContain(
  17. "baseFeedbackService={baseFeedbackService}",
  18. );
  19. expect(appSource).toContain(
  20. "<FeedbackHost feedbackService={baseFeedbackService} platform={platform} />",
  21. );
  22. expect(appSource).not.toContain(
  23. "<FeedbackHost feedbackService={services?.feedbackService} platform={platform} />",
  24. );
  25. });
  26. });