|
1 | 1 | using DebugProbe.AspNetCore.Internal.Rendering; |
| 2 | +using DebugProbe.AspNetCore.Internal.Resources; |
2 | 3 | using DebugProbe.AspNetCore.Models; |
3 | 4 |
|
4 | 5 | namespace DebugProbe.AspNetCore.Tests.Rendering; |
@@ -26,6 +27,40 @@ public void Render_index_page_builds_page_with_entries() |
26 | 27 | Assert.Contains("200", html); |
27 | 28 | } |
28 | 29 |
|
| 30 | + [Fact] |
| 31 | + public void Render_index_page_constrains_path_cell_and_preserves_full_path_title() |
| 32 | + { |
| 33 | + var path = "/" + new string('a', 240); |
| 34 | + var query = "?filter=" + new string('b', 120); |
| 35 | + var fullPath = path + query; |
| 36 | + |
| 37 | + var html = HtmlRenderer.RenderIndexPage( |
| 38 | + [ |
| 39 | + new DebugEntry |
| 40 | + { |
| 41 | + Id = "trace-1", |
| 42 | + Method = "GET", |
| 43 | + Path = path, |
| 44 | + Query = query, |
| 45 | + StatusCode = 200, |
| 46 | + Timestamp = new DateTimeOffset(2026, 1, 2, 3, 4, 5, TimeSpan.Zero) |
| 47 | + } |
| 48 | + ]); |
| 49 | + |
| 50 | + Assert.Contains($@"<td class=""request-path""><span class=""request-path-value"" title=""{fullPath}"">{fullPath}</span></td>", html); |
| 51 | + } |
| 52 | + |
| 53 | + [Fact] |
| 54 | + public void Embedded_css_keeps_request_index_table_fixed_with_ellipsized_paths() |
| 55 | + { |
| 56 | + Assert.Contains("#requestTable", EmbeddedResources.Css); |
| 57 | + Assert.Contains("table-layout: fixed;", EmbeddedResources.Css); |
| 58 | + Assert.Contains(".request-path-value", EmbeddedResources.Css); |
| 59 | + Assert.Contains("overflow: hidden;", EmbeddedResources.Css); |
| 60 | + Assert.Contains("text-overflow: ellipsis;", EmbeddedResources.Css); |
| 61 | + Assert.Contains("white-space: nowrap;", EmbeddedResources.Css); |
| 62 | + } |
| 63 | + |
29 | 64 | [Fact] |
30 | 65 | public void Details_page_renders_captured_values() |
31 | 66 | { |
|
0 commit comments