remoteConnectionEntryVisibility.test.ts 773 B

12345678910111213141516171819202122232425262728293031
  1. import { describe, expect, it } from "vitest";
  2. import { shouldShowRemoteConnectionEntry } from "../src/hooks/useRemoteConnectionEntryVisibility.js";
  3. describe("shouldShowRemoteConnectionEntry", () => {
  4. it("test 环境始终返回 true", () => {
  5. expect(
  6. shouldShowRemoteConnectionEntry({
  7. env: "test",
  8. isIntranet: false,
  9. }),
  10. ).toBe(true);
  11. });
  12. it("生产态命中内网时返回 true", () => {
  13. expect(
  14. shouldShowRemoteConnectionEntry({
  15. env: "production",
  16. isIntranet: true,
  17. }),
  18. ).toBe(true);
  19. });
  20. it("生产态且非内网时也返回 true", () => {
  21. expect(
  22. shouldShowRemoteConnectionEntry({
  23. env: "production",
  24. isIntranet: false,
  25. }),
  26. ).toBe(true);
  27. });
  28. });