MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / render_includes_scope_and_constraints

Function render_includes_scope_and_constraints

atomic-canonical/src/render.rs:224–276  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

222
223 #[test]
224 fn render_includes_scope_and_constraints() {
225 let node = CanonicalNode {
226 context: CONTEXT_URL.to_string(),
227 type_: NodeType::Intent.as_str().to_string(),
228 id: "urn:atomic:intent:render-1".to_string(),
229 human_key: "R-1".to_string(),
230 title: "Render".to_string(),
231 status: "todo".to_string(),
232 priority: None,
233 view: None,
234 motivated_by: None,
235 informed_by: Vec::new(),
236 has_acceptance_criterion: Vec::new(),
237 has_task: Vec::new(),
238 has_scope_in: vec![scope("urn:atomic:scope:r-1-scope-in-1", "the modal markup")],
239 has_scope_out: vec![scope(
240 "urn:atomic:scope:r-1-scope-out-1",
241 "persisting across reloads",
242 )],
243 has_constraint: vec![
244 Constraint {
245 type_: NodeType::Constraint.as_str().to_string(),
246 id: "urn:atomic:constraint:r-1-constraint-1".to_string(),
247 text: "keep it local".to_string(),
248 },
249 Constraint {
250 type_: NodeType::Constraint.as_str().to_string(),
251 id: "urn:atomic:constraint:r-1-constraint-2".to_string(),
252 text: "do not touch the keyboard handler".to_string(),
253 },
254 ],
255 depends_on: vec![Ref {
256 type_: None,
257 id: None,
258 to: "urn:atomic:intent:xyz".to_string(),
259 edge: "blockedBy".to_string(),
260 }],
261 why: Some("a reason".to_string()),
262 content_hash: None,
263 attributed_to: None,
264 created_at: "2026-06-25T00:00:00Z".to_string(),
265 proof: None,
266 };
267
268 let text = render(&node, Target::Cli);
269 assert!(text.contains("Out of Scope"), "render:\n{text}");
270 assert!(text.contains("persisting across reloads"));
271 assert!(text.contains("keep it local"));
272 assert!(text.contains("do not touch the keyboard handler"));
273 // Dependency rendered as 'edge -> to'.
274 assert!(text.contains("blockedBy"));
275 assert!(text.contains("blockedBy -> urn:atomic:intent:xyz"));
276 }
277
278 #[test]
279 fn render_memory_regenerates_status_from_spine() {

Callers

nothing calls this directly

Calls 2

renderFunction · 0.70
as_strMethod · 0.45

Tested by

no test coverage detected