diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-02-01 09:10:05 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-02-01 09:10:21 +0100 |
| commit | 99bbda5cb95451132ac14ca5aec02cdd70fb9bcb (patch) | |
| tree | 09800e18cc6de91abd8c2b69066194853de42b58 /lua/alpha/snips | |
| parent | 06e2581cf8ee20470a27aa2e8cb203cd133a01ea (diff) | |
| download | nvim-conf-99bbda5cb95451132ac14ca5aec02cdd70fb9bcb.tar.gz nvim-conf-99bbda5cb95451132ac14ca5aec02cdd70fb9bcb.zip | |
feat: add cucumber sets for behat tests
Diffstat (limited to 'lua/alpha/snips')
| -rw-r--r-- | lua/alpha/snips/ft/cucumber.lua | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/lua/alpha/snips/ft/cucumber.lua b/lua/alpha/snips/ft/cucumber.lua index 5c183b2..cb74586 100644 --- a/lua/alpha/snips/ft/cucumber.lua +++ b/lua/alpha/snips/ft/cucumber.lua @@ -1,9 +1,64 @@ 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]], + 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 |