Skip to content

Commit fe83694

Browse files
committed
test: repo index tests
1 parent edc8311 commit fe83694

File tree

8 files changed

+351
-12
lines changed

8 files changed

+351
-12
lines changed

lib/librecov_web/live/repository_live/index.html.heex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="content">
1+
<div class="content" id="repositories-index">
22
<%= if @live_action in [:new, :edit] do %>
33
<%= live_modal @socket, Librecov.RepositoryLive.FormComponent,
44
id: @repository.id || :new,

lib/librecov_web/live/repository_live/show.html.heex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
return_to: Routes.repository_show_path(@socket, :show, @repository) %>
99
<% end %>
1010

11-
<div class="bg-image">
11+
<div class="bg-image" id="repo-header">
1212
<div class="bg-primary-dark-op">
1313
<div class="content content-full">
1414
<div class="d-flex flex-column flex-sm-row justify-content-sm-between align-items-sm-center mt-5 mb-2 text-center text-sm-start">
@@ -50,7 +50,7 @@
5050
</div>
5151
</div>
5252

53-
<div class="content">
53+
<div class="content" id="repo-info">
5454
<!-- Stats -->
5555
<div class="row">
5656
<div class="col-6 col-md-3 col-lg-6 col-xl-3">
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"<div class=\"content\" id=\"repositories-index\"><h2 class=\"content-heading\">\n Repos\n </h2><div class=\"row\"><div class=\"col-md-6\"><div class=\"block block-rounded block-bordered block-fx-pop\"><div class=\"block-header block-header-default\"><h3 class=\"block-title\"><a data-phx-link=\"redirect\" data-phx-link-state=\"push\" href=\"/repositories/octocat/Hello-World\">octocat/Hello-World</a></h3><div class=\"block-options\"></div></div><div class=\"block-content block-content-full ribbon ribbon-danger ribbon-bookmark\"><div class=\"ribbon-box\">\n 50.0%\n </div><p>This your first repo!</p><p class=\"card-text text-muted\"><a class=\"text-muted\" data-phx-link=\"redirect\" data-phx-link-state=\"push\" href=\"/builds/443\">oie shi</a>\n\n \n on branch <span class=\"font-italic\">main</span></p><a target=\"_blank\" class=\"badge rounded-pill bg-secondary\" href=\"https://github.com/topics/octocat\">octocat</a><a target=\"_blank\" class=\"badge rounded-pill bg-secondary\" href=\"https://github.com/topics/atom\">atom</a><a target=\"_blank\" class=\"badge rounded-pill bg-secondary\" href=\"https://github.com/topics/electron\">electron</a><a target=\"_blank\" class=\"badge rounded-pill bg-secondary\" href=\"https://github.com/topics/api\">api</a></div><div class=\"block-content bg-light px-4 py-2 m-0\"><small class=\"text-muted\"><i class=\"fas fa-history\"></i> Updated now</small></div></div></div></div></div>"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"<div class=\"content\" id=\"repositories-index\"><h2 class=\"content-heading\">\n Repos\n </h2><div class=\"row\"><div class=\"col-md-6\"><div class=\"block block-rounded block-bordered block-fx-pop\"><div class=\"block-header block-header-default\"><h3 class=\"block-title\">\n \n octocat/Hello-World\n \n </h3><div class=\"block-options\"><a target=\"_blank\" class=\"btn-block-option\" href=\"https://github.com/octocat/Hello-World/settings/installations\"><i class=\"si si-settings\"></i></a></div></div><div class=\"block-content block-content-full ribbon ribbon-info ribbon-bookmark\"><p>This your first repo!</p><a target=\"_blank\" class=\"badge rounded-pill bg-secondary\" href=\"https://github.com/topics/octocat\">octocat</a><a target=\"_blank\" class=\"badge rounded-pill bg-secondary\" href=\"https://github.com/topics/atom\">atom</a><a target=\"_blank\" class=\"badge rounded-pill bg-secondary\" href=\"https://github.com/topics/electron\">electron</a><a target=\"_blank\" class=\"badge rounded-pill bg-secondary\" href=\"https://github.com/topics/api\">api</a></div><div class=\"block-content bg-light px-4 py-2 m-0\"><small class=\"text-muted\"><i class=\"fas fa-history\"></i> Updated 10 years ago</small></div></div></div></div></div>"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
%{
2+
content: "<div class=\"content\" id=\"repo-info\"><!-- Stats --><div class=\"row\"><div class=\"col-6 col-md-3 col-lg-6 col-xl-3\"><a href=\"javascript:void(0)\" class=\"block block-rounded block-link-pop border-start border-4 border-danger\"><div class=\"block-content block-content-full\"><div class=\"fs-sm fw-semibold text-uppercase text-muted\">Main Branch</div><div class=\"fs-2 fw-normal text-dark\">50.0%</div></div></a></div><div class=\"col-6 col-md-3 col-lg-6 col-xl-3\"><a href=\"javascript:void(0)\" class=\"block block-rounded block-link-pop border-start border-4 border-success\"><div class=\"block-content block-content-full\"><div class=\"fs-sm fw-semibold text-uppercase text-muted\">Latest Build</div><div class=\"fs-2 fw-normal text-dark\">99.9%</div></div></a></div><div class=\"col-6 col-md-3 col-lg-6 col-xl-3\"><a class=\"block block-rounded block-link-pop border-start border-primary border-4\" href=\"javascript:void(0)\"><div class=\"block-content block-content-full\"><div class=\"fs-sm fw-semibold text-uppercase text-muted\">Main Branch Builds</div><div class=\"fs-2 fw-normal text-dark\">0</div></div></a></div><div class=\"col-6 col-md-3 col-lg-6 col-xl-3\"><a class=\"block block-rounded block-link-pop border-start border-primary border-4\" href=\"javascript:void(0)\"><div class=\"block-content block-content-full\"><div class=\"fs-sm fw-semibold text-uppercase text-muted\">Total Builds</div><div class=\"fs-2 fw-normal text-dark\">1</div></div></a></div></div><!-- END Stats --><!-- Customers and Latest Orders --><div class=\"row row-deck\"><!-- Latest Orders --><div class=\"col-lg-12\"><div class=\"block block-rounded block-mode-loading-oneui\"><div class=\"block-header block-header-default\"><h3 class=\"block-title\">Recent Builds</h3></div><div class=\"block-content block-content-full\"><table class=\"table table-striped table-hover table-borderless table-vcenter fs-sm mb-0\"><thead><tr class=\"text-uppercase\"><th class=\"fw-bold\">ID</th><th class=\"d-none d-sm-table-cell fw-bold\">Branch</th><th class=\"fw-bold\">Coverage</th><th class=\"d-none d-sm-table-cell fw-bold\">Diff</th><th class=\"d-none d-sm-table-cell fw-bold\">Commit</th><th class=\"d-none d-sm-table-cell fw-bold\">Commiter</th><th class=\"d-none d-sm-table-cell fw-bold\">Time</th><th class=\"d-none d-sm-table-cell fw-bold\">Via</th></tr></thead><tbody><tr><td><span class=\"fw-semibold\"><a data-phx-link=\"redirect\" data-phx-link-state=\"push\" href=\"/builds/443\">#0</a></span></td><td class=\"d-none d-sm-table-cell\"><span class=\"fs-sm text-muted\">main</span></td><td><span class=\"fw-semibold text-success\">99.9%</span></td><td><span class=\"fw-semibold\"><span class=\"text-success\"><i class=\"fas fa-arrow-circle-up\"></i>49.8%\n </span></span></td><td><span class=\"fw-semibold\">\n oie shi\n \n <a href=\"https://github.com/tuvistavie/name-2/commit/\"><i class=\"fab github-alt\"></i></a></span></td><td class=\"d-none d-sm-table-cell\"></td><td class=\"d-none d-sm-table-cell\">\n about 18 hours ago\n </td><td class=\"d-none d-sm-table-cell\"></td></tr></tbody></table></div></div></div><!-- END Latest Orders --></div><!-- END Customers and Latest Orders --></div>",
3+
header: "<div class=\"bg-image\" id=\"repo-header\"><div class=\"bg-primary-dark-op\"><div class=\"content content-full\"><div class=\"d-flex flex-column flex-sm-row justify-content-sm-between align-items-sm-center mt-5 mb-2 text-center text-sm-start\"><div class=\"flex-grow-1\"><h1 class=\"fw-semibold text-white mb-0\">octocat/Hello-World</h1><h2 class=\"h4 fw-normal text-white-75 mb-0\">Code Coverage Report</h2></div><div class=\"flex-shrink-0 mt-3 mt-sm-0 ms-sm-3\"><span class=\"d-inline-block btn-group\"><div class=\"btn-group\"><button class=\"btn btn-primary px-4 py-2 dropdown-toggle\" type=\"button\" id=\"dropdownMenuClickable\" data-bs-toggle=\"dropdown\" data-bs-auto-close=\"false\" aria-expanded=\"false\"><i class=\"fas fa-key me-1 opacity-50\"></i> Show Token\n </button><ul class=\"dropdown-menu\" aria-labelledby=\"dropdownMenuClickable\"><li><h6 class=\"dropdown-header\">Token</h6></li><li><pre><code><span class=\"dropdown-item\">my_secret_token_4</span></code></pre></li></ul></div><div class=\"btn-group\"><button class=\"btn btn-primary px-4 py-2 dropdown-toggle\" type=\"button\" id=\"dropdownMenuClickable2\" data-bs-toggle=\"dropdown\" data-bs-auto-close=\"false\" aria-expanded=\"false\"><i class=\"far fa-image me-1 opacity-50\"></i> Get Badge\n </button><ul class=\"dropdown-menu\" aria-labelledby=\"dropdownMenuClickable2\"><li><img class=\"dropdown-header\" src=\"/projects/1337/badge.svg\"/></li><li><h6 class=\"dropdown-header\">Markdown</h6></li><li><pre class=\"dropdown-item\"><code class=\"language-markdown\">\n [![Coverage Status](http://localhost:4001/projects/1337/badge.svg)](http://localhost:4001/repositories/octocat/Hello-World)\n </code></pre></li></ul></div><a class=\"btn btn-primary px-4 py-2 js-click-ripple-enabled\" href=\"https://github.com/octocat/Hello-World\" style=\"overflow: hidden; position: relative; z-index: 1;\" target=\"_blank\"><i class=\"fab fa-github me-1 opacity-50\"></i> Open\n</a></span></div></div></div></div></div>"
4+
}

0 commit comments

Comments
 (0)