Add a regression test for Razor implements interfaces

Covers the repaired directive directly: two @implements lines on
one component each mint their interface and both land on the
implements relation.

(cherry picked from commit fcb4177026)
This commit is contained in:
ayushcodes10 authored and safishamsi committed 2026-10-27 17:21:26 +00:00
1 parent b69b7510c2
commit 506d6ff5fb
1 file changed
+16
+16
View File
@@ -701,6 +701,22 @@ def test_razor_inherits():
assert "inherits" in _relations(r)
def test_razor_implements(tmp_path: Path):
page = tmp_path / "Clock.razor"
page.write_text(
"@implements IDisposable\n@implements IAsyncDisposable\n",
encoding="utf-8",
)
r = extract_razor(page)
labels = _labels(r)
assert "IDisposable" in labels
assert "IAsyncDisposable" in labels
implements_targets = {
e["target"] for e in r["edges"] if e["relation"] == "implements"
}
assert len(implements_targets) == 2
def test_razor_code_methods():
r = extract_razor(FIXTURES / "sample.razor")
labels = _labels(r)