aboutsummaryrefslogtreecommitdiffstats
path: root/lua/pi/snips/ft/cucumber.lua
diff options
context:
space:
mode:
authorElvis Claros Castro <elvis@claros.ar>2024-07-12 11:18:14 -0300
committerElvis Claros Castro <elvis@claros.ar>2024-07-12 11:18:14 -0300
commitea0f4bf8ffade657b1d45152dbc183d4679e75c4 (patch)
treecc1fb023bc308e019ddce33a4b0aed39f56805dc /lua/pi/snips/ft/cucumber.lua
parent1fd0af14d592d612c2aaab7717c04c8806ba3daa (diff)
downloadnvim-conf-ea0f4bf8ffade657b1d45152dbc183d4679e75c4.tar.gz
nvim-conf-ea0f4bf8ffade657b1d45152dbc183d4679e75c4.zip
Feat: PI
Diffstat (limited to 'lua/pi/snips/ft/cucumber.lua')
-rw-r--r--lua/pi/snips/ft/cucumber.lua71
1 files changed, 71 insertions, 0 deletions
diff --git a/lua/pi/snips/ft/cucumber.lua b/lua/pi/snips/ft/cucumber.lua
new file mode 100644
index 0000000..6176a87
--- /dev/null
+++ b/lua/pi/snips/ft/cucumber.lua
@@ -0,0 +1,71 @@
+local ls = require "luasnip"
+local t = ls.text_node
+local i = ls.insert_node
+local c = ls.choice_node
+local fmt = require("luasnip.extras.fmt").fmt
+
+local M = {
+ clean = t [[Given clean stubs list]],
+ all = t [[And all stubs should be matched]],
+ status_code = fmt([[Then the response status code should be {}]], { i(1, "200") }),
+ no_error = t [[And the JSON path expression errors should not have result]],
+ json_data = fmt([[And the JSON path expression "data" should be equal to:
+"""
+{{
+ {}
+}}
+"""
+ ]], {i(1)}),
+ feature = fmt(
+ [[Feature: {}
+
+ {}
+]],
+ {
+ i(1, "Feature Name"),
+ i(0),
+ }
+ ),
+ scenario = fmt(
+ [[Scenario: {}
+ {}]],
+ {
+ i(1, "Scenario name"),
+ i(0),
+ }
+ ),
+ stub = fmt([[And the APIClient will send a request with a stub from "{}"]], { i(1) }),
+ request = fmt(
+ [[When I send the GraphQL request:
+"""
+{}
+"""]],
+ { i(1) }
+ ),
+ result = fmt(
+ [[And the JSON path expression "data" should be equal to:
+"""
+{{
+ "result": {{
+ {}
+ }}
+}}
+"""]],
+ { i(1) }
+ ),
+ query = fmt(
+ [[{} {{
+result: {}({}) {{
+ {}
+}}
+ }}]],
+ { c(1, { t "mutation", t "query" }), i(2, "mutation"), i(3, ""), i(4) }
+ ),
+ access = fmt(
+ [[And the Access Cache has Allowed the userId "{}" for inspectionId "{}"]],
+ { i(1, "3414054"), i(2, "42") }
+ ),
+ branch_access = fmt([[And the Access Cache has branch "{}" for userId "{}"]], { i(1, "1"), i(2, "3414054") }),
+}
+
+return M