()
| 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 | |
| 114 | mod upsert_link { |
nothing calls this directly
no test coverage detected