MCPcopy Create free account
hub / github.com/emwalker/digraph / topics_updated

Function topics_updated

backend/tests/git/link.rs:83–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81
82 #[test]
83 fn topics_updated() {
84 let f = Fixtures::copy("simple");
85 let repo_id = RepoId::wiki();
86 let parent1 = ExternalId::root_topic();
87 let parent2 = parse_id("00001");
88 let url = valid_url();
89
90 let UpsertLinkResult { link, .. } = f.upsert_link(
91 repo_id,
92 &url,
93 Some("Page title".into()),
94 Some(parent1.to_owned()),
95 );
96 let link = link.unwrap();
97 assert_eq!(link.parent_topics.len(), 1);
98
99 UpdateLinkParentTopics {
100 actor: actor(),
101 repo_id,
102 link_id: link.id().to_owned(),
103 parent_topic_ids: BTreeSet::from([parent1, parent2]),
104 }
105 .call(f.mutation(), &redis::Noop)
106 .unwrap();
107
108 let link_id = link.id();
109 let link = f.git.fetch_link(repo_id, link_id).unwrap();
110 assert_eq!(link.parent_topics.len(), 2);
111 }
112}
113
114mod upsert_link {

Callers

nothing calls this directly

Calls 8

parse_idFunction · 0.85
valid_urlFunction · 0.85
actorFunction · 0.85
upsert_linkMethod · 0.45
callMethod · 0.45
idMethod · 0.45
mutationMethod · 0.45
fetch_linkMethod · 0.45

Tested by

no test coverage detected