Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions src/pages/resources/ResourcesMethodologyPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import ResourcesMethodologyPage from "./ResourcesMethodologyPage";
import { REGION_MAPPING_DISCLAIMER } from "../../utils/geographyUtils";
import { MockIntersectionObserver } from "../../test/mockIntersectionObserver";

const TERRITORIAL_CLAIMS =
"RMI does not make any statements on country delineations and/or conflicting territorial claims.";

const renderPage = () =>
render(
<MemoryRouter>
Expand All @@ -23,30 +20,26 @@ const countOf = (haystack: string, needle: string): number =>
haystack.split(needle).length - 1;

describe("ResourcesMethodologyPage — Regions note", () => {
it("states that region mappings come from the pathway's model, not RMI (#800)", () => {
it("states that regional representations follow the data sources, not RMI (#917)", () => {
const { container } = renderPage();
expect(flatText(container)).toContain(REGION_MAPPING_DISCLAIMER);
expect(flatText(container)).toContain(`Note: ${REGION_MAPPING_DISCLAIMER}`);
});

it("keeps the existing territorial-claims sentence in the same note", () => {
it("drops the earlier territorial-claims sentence and shows the note once", () => {
const { container } = renderPage();
const text = flatText(container);

expect(text).toContain(TERRITORIAL_CLAIMS);
// Reconciled into one note rather than added alongside the old one — a second
// near-duplicate note is exactly what #800 asked us to avoid.
expect(countOf(text, TERRITORIAL_CLAIMS)).toBe(1);
expect(text).not.toContain("conflicting territorial claims");
expect(countOf(text, REGION_MAPPING_DISCLAIMER)).toBe(1);
});

it("renders the note as a single italic block", () => {
const { container } = renderPage();

const italics = Array.from(container.querySelectorAll("i")).filter((el) =>
(el.textContent ?? "").replace(/\s+/g, " ").includes(TERRITORIAL_CLAIMS),
flatText(el).includes(REGION_MAPPING_DISCLAIMER),
);
expect(italics).toHaveLength(1);
expect(flatText(italics[0])).toContain(REGION_MAPPING_DISCLAIMER);
});

it("shows the note without any interaction, now that subsections no longer collapse (#955)", () => {
Expand Down
13 changes: 5 additions & 8 deletions src/pages/resources/ResourcesMethodologyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,13 @@ const ResourcesMethodologyPage: React.FC = () => {
are allowed, based on ISO2 (3166) definitions. Regions are
provided as defined in the pathway.
</p>
{/* Kept as a single italic block: #800 reconciled two
near-duplicate notes into this one, and the test suite
asserts exactly one italic run carries it. */}
{/* Kept as a single italic block: #917 replaced the
earlier two-sentence note with the policy wording alone,
and the test suite asserts exactly one italic run carries
it. */}
<InfoCallout>
<p>
<i>
Note: {REGION_MAPPING_DISCLAIMER} RMI does not make
any statements on country delineations and/or
conflicting territorial claims.
</i>
<i>Note: {REGION_MAPPING_DISCLAIMER}</i>
</p>
</InfoCallout>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/utils/geographyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ countries.registerLocale(en);

export type GeographyKind = "global" | "region" | "country";

// Approved wording from #800 (2026-08-10). Single source of truth for the
// region-mapping disclaimer, rendered on the methodology page, in the detail-page
// geography tooltip, and under the Geography filter dropdown — the three places a
// user meets a region→country mapping.
// Wording from the RMI policy doc (#917, replacing #800's). Single source of truth
// for the region-mapping disclaimer, rendered on the methodology page, in the
// detail-page geography tooltip, and under the Geography filter dropdown — the
// three places a user meets a region→country mapping.
export const REGION_MAPPING_DISCLAIMER =
"The mapping of any individual country or territory to a region reflects the " +
"mappings of the model used in the pathway. It does not reflect any opinion of RMI.";
"Country and regional representations follow the conventions used in the " +
"underlying data sources and do not reflect any institutional point of view by RMI.";

// Flatten the structured geography object into the ordered flat token list the
// rest of the app historically operated on: "Global" (when global) → region
Expand Down
Loading