Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: seeding policy implicitly set warning test
Adrian Duke committed 2 months ago
commit 9f8b9665e8f7adab16e63947ca706ba681392a85
parent 244e3008bcb9c4a587ed6de702544aa43621592c
2 files changed +28 -0
added crates/radicle-cli/examples/rad-seed-policy-allow-no-scope.md
@@ -0,0 +1,7 @@
+
We want to ensure that a warning is printed when the `scope` field is missing in the `seedingPolicy`.
+

+
``` alice
+
$ rad node status
+
! Warning: node 'seedingPolicy.scope' has been set to 'all' by default. This default value will be removed in a future release. Please explicitly set it to one of ['all', 'followed'] in your node config.
+
[..]
+
```
modified crates/radicle-cli/tests/commands.rs
@@ -2871,3 +2871,24 @@ fn rad_workflow() {
    )
    .unwrap();
}
+

+
#[test]
+
fn rad_seed_policy_allow_no_scope() {
+
    let mut environment = Environment::new();
+
    let alice = environment.node_with(Config {
+
        seeding_policy: DefaultSeedingPolicy::Allow {
+
            scope: node::config::Scope::implicit(),
+
        },
+
        ..Config::test(Alias::new("alice"))
+
    });
+

+
    let alice = alice.spawn();
+

+
    test(
+
        "examples/rad-seed-policy-allow-no-scope.md",
+
        environment.work(&alice),
+
        Some(&alice.home),
+
        [],
+
    )
+
    .unwrap();
+
}