Skip to content

Commit 72fd21a

Browse files
committed
tests/blink-cmp: test that provider settings are propagated
1 parent 2bdf749 commit 72fd21a

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

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

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

0 commit comments

Comments
 (0)