Skip to content

Commit c390e45

Browse files
committed
tests/blink-cmp: test that provider settings are propagated
1 parent d3beeeb commit c390e45

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

tests/test-sources/plugins/by-name/blink-cmp/default.nix

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,4 +406,52 @@
406406
};
407407
};
408408
};
409+
410+
# Test that a provider plugin's settings are propagated to `plugins.blink-cmp.settings.providers`
411+
provider-settings =
412+
{
413+
config,
414+
options,
415+
lib,
416+
...
417+
}:
418+
let
419+
expectEqual = name: expected: actual: {
420+
assertion = expected == actual;
421+
message = ''
422+
Expected ${name} to equal:
423+
${lib.generators.toPretty { } expected}
424+
But found:
425+
${lib.generators.toPretty { } actual}
426+
'';
427+
};
428+
in
429+
{
430+
test.buildNixvim = false;
431+
assertions = [
432+
(expectEqual "config.plugins.blink-cmp-git.blink.settings" {
433+
name = "git";
434+
module = "blink-cmp-git";
435+
bar = "bar";
436+
opts.foo = "foo";
437+
} (lib.filterAttrs (_: v: v != null) config.plugins.blink-cmp-git.blink.settings))
438+
(expectEqual "config.plugins.blink-cmp.settings.sources.providers.git" {
439+
name = "git";
440+
module = "blink-cmp-git";
441+
bar = "bar";
442+
opts.foo = "foo";
443+
} (lib.filterAttrs (_: v: v != null) config.plugins.blink-cmp.settings.sources.providers.git))
444+
];
445+
446+
plugins.blink-cmp.enable = true;
447+
plugins.blink-cmp-git = {
448+
enable = true;
449+
settings = {
450+
foo = "foo";
451+
};
452+
blink.settings = {
453+
bar = "bar";
454+
};
455+
};
456+
};
409457
}

0 commit comments

Comments
 (0)