Skip to content

Commit

Permalink
add: fbt tests for http endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
harshdoesdev authored and amitu committed Feb 15, 2024
1 parent 748b9a3 commit e7e8264
Show file tree
Hide file tree
Showing 36 changed files with 12,326 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fastn-core/tests/21-http-endpoint/cmd.p1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- fbt:
cmd: $FBT_CWD/../target/debug/fastn --test build
output: .build

-- stdout:

Updated package dependency.
Processing fastn-stack.github.io/http-endpoint-test/manifest.json ... done in <omitted>
Processing fastn-stack.github.io/http-endpoint-test/FASTN/ ... done in <omitted>
Processing fastn-stack.github.io/http-endpoint-test/ ... done in <omitted>
7 changes: 7 additions & 0 deletions fastn-core/tests/21-http-endpoint/input/FASTN.ftd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- import: fastn

-- fastn.package: fastn-stack.github.io/http-endpoint-test

-- fastn.url-mappings:

/api/* -> http+proxy://reqres.in/api/*
31 changes: 31 additions & 0 deletions fastn-core/tests/21-http-endpoint/input/index.ftd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- import: fastn/processors as pr

-- record user-data:
integer id:
string email:
string first_name:

-- record user:
user-data data:


-- user u:
$processor$: pr.http
url: /api/users/2


-- component display-user:
user u:

-- ftd.row:
spacing.fixed.rem: 1

-- ftd.integer: $display-user.u.data.id

-- ftd.text: $display-user.u.data.first_name

-- ftd.text: $display-user.u.data.email

-- end: ftd.row

-- end: display-user
216 changes: 216 additions & 0 deletions fastn-core/tests/21-http-endpoint/output/.fastn/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
{
"package": "fastn-stack.github.io/http-endpoint-test",
"all_packages": {
"fastn-stack.github.io/fastn-ui": {
"files": {
"FASTN.ftd": {
"name": "FASTN.ftd",
"checksum": "22E9BA037F761093E2BEA5C9D4E33E03787661992D94BA0612BD996FFA1AAE0F",
"size": 208
},
"arrow-right.png": {
"name": "arrow-right.png",
"checksum": "9F08169F542CB20A17F9432290A23B35DA8E815718E13749C125E5C915398036",
"size": 264
},
"code.ftd": {
"name": "code.ftd",
"checksum": "55817640588F621BDE4A4850AED568085E2C1E9CBBCD7C399C0FADA7DB6E512C",
"size": 125
},
"create-cr.ftd": {
"name": "create-cr.ftd",
"checksum": "17C19856B09572E56A82BB37704A69F8505022A65D792CB6E4E89750E84FA263",
"size": 659
},
"cross.svg": {
"name": "cross.svg",
"checksum": "030E3E7DBA0BD039E86E78A1DA968F24EA0811FB1C4CAD3481E18947A3F7A1D4",
"size": 1483
},
"delete-icon.svg": {
"name": "delete-icon.svg",
"checksum": "52593C3DC6B757A0F683709E254559723400EC0633915866E60E5B3F6DA0922C",
"size": 2944
},
"delete.png": {
"name": "delete.png",
"checksum": "044778C91335EC245858A656123EF2B561558C4554B59AAAB36D2208A35C9CD7",
"size": 647
},
"desktop-active.svg": {
"name": "desktop-active.svg",
"checksum": "8775C6BF6DCF54FBB347C2484900F65BE08FC2E9F7A1A22F377589E53ACB57CE",
"size": 740
},
"desktop.svg": {
"name": "desktop.svg",
"checksum": "2F345251CAAD01E884CD37EEE0AC4E939ABD092428A9B83BDB4886892456C1C8",
"size": 740
},
"downarrow.svg": {
"name": "downarrow.svg",
"checksum": "3EDC5E9D3185DABE1ED80673A59B38FA26B86905585C66DAC3DB10038800DEEA",
"size": 493
},
"e-active.svg": {
"name": "e-active.svg",
"checksum": "21373E1D1CB66CFDBD4DC69207F6EE1737EC5375CD2061B5EB704790AE19022C",
"size": 285
},
"e-default.svg": {
"name": "e-default.svg",
"checksum": "C0F739A6B7182CD32FB54732DBB375D9DD880613118758B65051F19F93F8EED4",
"size": 226
},
"edit-icon-default.svg": {
"name": "edit-icon-default.svg",
"checksum": "3E413DAEDE33A18766C486523F19F7B3EC3C1F13E93BEAC85E503B718D0E7B93",
"size": 680
},
"edit-icon.svg": {
"name": "edit-icon.svg",
"checksum": "A13E52D1FCC7FD76FD39CB697432D4AC3C47290991558B63A3FDEB43C483B1E8",
"size": 590
},
"edit.svg": {
"name": "edit.svg",
"checksum": "7E234382BB2096A022CF12D258515210D30BE7F5D2866902D711E90592F8CB46",
"size": 676
},
"editor-icon.svg": {
"name": "editor-icon.svg",
"checksum": "AE8CCE7B1D9EEBE7590EF2A519453CB2059C94E230393D6E1074E0D17F605C51",
"size": 2934
},
"editor.ftd": {
"name": "editor.ftd",
"checksum": "E4EC691229D5AE382614B0E3E066E14C4E8FABECCE861DDDD6BC24CFF4BAFFFA",
"size": 59032
},
"file.svg": {
"name": "file.svg",
"checksum": "56417622D53BA855271F5A0455F841BA4E084D326C733C461900F860ECEEC162",
"size": 1512
},
"folder-icon.svg": {
"name": "folder-icon.svg",
"checksum": "09558AC0F284D4FF37E0B94A2275C3A988B77E465FBA15C9A61650EA57D6D903",
"size": 995
},
"git-pull-request.svg": {
"name": "git-pull-request.svg",
"checksum": "F86F00421FA0F656E252440C2675E78E5B952C6343D7BB161F0092C5A1728416",
"size": 1302
},
"image.ftd": {
"name": "image.ftd",
"checksum": "58F326B131268701961B0E1763109CAD8CB1A9D8D864720135E63A11EA26B3EC",
"size": 73
},
"index.ftd": {
"name": "index.ftd",
"checksum": "3088825DA1446D71924305D7B073D03294A1E7E466AF8EF9449FE0A0CDAC3683",
"size": 4040
},
"local-active.svg": {
"name": "local-active.svg",
"checksum": "2DDC6BB01721570A9955188F46051140A457B4776FA0B080A08030F558B8D094",
"size": 292
},
"local.svg": {
"name": "local.svg",
"checksum": "1D9CCBE45D0D80A9367852BEEFB7930B63FC78413076784F32E32832C3741319",
"size": 292
},
"m-active.svg": {
"name": "m-active.svg",
"checksum": "B43127FA9B7B528A2A0858F6CF8E35C0D74E4F810B6A0098AE832FB052CBB51A",
"size": 340
},
"m-default.svg": {
"name": "m-default.svg",
"checksum": "8D94D17FE48001159854B031AF5D96E9220171ACAABEA7A5514E7D19EB24CA1F",
"size": 279
},
"markdown.ftd": {
"name": "markdown.ftd",
"checksum": "E49C79D420F5A91ACBFD6F891D03062EE9CE9F17743180872D85BE6994E738A6",
"size": 104
},
"mobile-active.svg": {
"name": "mobile-active.svg",
"checksum": "EAE169027F9884E0559E95793F626EB41FE0340511E0D8BED1EC55390B8E7E04",
"size": 1493
},
"mobile-frame.png": {
"name": "mobile-frame.png",
"checksum": "6B5910F7EB38FFD7B0518661A2A4AF52FCBC825E3F0ADCA166A17FA92D77D98B",
"size": 42009
},
"mobile.svg": {
"name": "mobile.svg",
"checksum": "38B6E21D51CBD7864FA2365BB127BB86A30337574CA1DF47C9C1369DCDA8D65C",
"size": 1485
},
"new-file-icon.svg": {
"name": "new-file-icon.svg",
"checksum": "652F3B1C3FCD4F85821925FC5DBF7ADB0F964A3F2F530B821D5D8C5C47B2F11F",
"size": 2982
},
"original-status.ftd-0.2": {
"name": "original-status.ftd-0.2",
"checksum": "146E13845A43A62192CFC5CEBB46C706C97998C811F4ECFEBF10E259AFBA379E",
"size": 3306
},
"package-info.ftd": {
"name": "package-info.ftd",
"checksum": "DDAC4D477EAB215452C3B904C906460816AFEBE8CF1027CC1E5EA8363F99457F",
"size": 881
},
"refresh.svg": {
"name": "refresh.svg",
"checksum": "0BE9E00669EF7798975D06DBD704D80C1DD348D712B2FB0728836F5959CAF538",
"size": 1354
},
"rename.png": {
"name": "rename.png",
"checksum": "6E653D8E53E6B826ACD190A365263CD0D4E560506D436DBD3C7C688BC392BB67",
"size": 464
},
"right-arrow.svg": {
"name": "right-arrow.svg",
"checksum": "4F72E539073791B9C9F1A4738381A60021372A8F512FC8F4621D5A641FD7943D",
"size": 426
},
"server-active.svg": {
"name": "server-active.svg",
"checksum": "35B41E77D4AAA14FF83CB1761197374B4C5206DACEBBB2ECE44CE07BD5683131",
"size": 318
},
"server.svg": {
"name": "server.svg",
"checksum": "55E91C6C89BC3818EB771AA08F37D97FDAE9E17E8CEE9B429AD456C2A49AB935",
"size": 318
},
"showbar.svg": {
"name": "showbar.svg",
"checksum": "F6109ECDC65DFEFC3B371EB878638BE9D96F7325C3F67CE23D7E8A7E9A172E9E",
"size": 795
},
"sync.svg": {
"name": "sync.svg",
"checksum": "86D7130343B46622211A67074289D55536122FE441E27B32E612ED795B259E00",
"size": 1427
},
"translation-status.ftd": {
"name": "translation-status.ftd",
"checksum": "F46AF144A7CB8201D123EEE299613F2964DF64A36A5451BF67941DF990D463D2",
"size": 3168
}
},
"zip_url": "https://github.com/fastn-stack/fastn-ui/archive/9b154f7807d317c4f617b06726a11ca2ab0a42a1.zip",
"checksum": "01F7EA2F19DBBC720D062757D833BA3C63D282FC7111C13E9E904391EC8CDBFD"
}
}
}
7 changes: 7 additions & 0 deletions fastn-core/tests/21-http-endpoint/output/FASTN.ftd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- import: fastn

-- fastn.package: fastn-stack.github.io/http-endpoint-test

-- fastn.url-mappings:

/api/* -> http+proxy://reqres.in/api/*
Loading

0 comments on commit e7e8264

Please sign in to comment.