Hide message content in HTML when linking to an image

Closes #695
This commit is contained in:
Oleksii Holub
2022-06-29 21:43:43 +03:00
parent 356b1a6afd
commit edba9f36a7
13 changed files with 121 additions and 117 deletions

View File

@@ -41,16 +41,14 @@ public class DateRangeSpecs : IClassFixture<TempOutputFixture>
After = Snowflake.FromDate(after)
}.ExecuteAsync(new FakeConsole());
var data = await File.ReadAllTextAsync(filePath);
var document = Json.Parse(data);
var timestamps = document
// Assert
var timestamps = Json
.Parse(await File.ReadAllTextAsync(filePath))
.GetProperty("messages")
.EnumerateArray()
.Select(j => j.GetProperty("timestamp").GetDateTimeOffset())
.ToArray();
// Assert
timestamps.All(t => t > after).Should().BeTrue();
timestamps.Should().BeEquivalentTo(new[]
@@ -87,16 +85,14 @@ public class DateRangeSpecs : IClassFixture<TempOutputFixture>
Before = Snowflake.FromDate(before)
}.ExecuteAsync(new FakeConsole());
var data = await File.ReadAllTextAsync(filePath);
var document = Json.Parse(data);
var timestamps = document
// Assert
var timestamps = Json
.Parse(await File.ReadAllTextAsync(filePath))
.GetProperty("messages")
.EnumerateArray()
.Select(j => j.GetProperty("timestamp").GetDateTimeOffset())
.ToArray();
// Assert
timestamps.All(t => t < before).Should().BeTrue();
timestamps.Should().BeEquivalentTo(new[]
@@ -133,16 +129,14 @@ public class DateRangeSpecs : IClassFixture<TempOutputFixture>
After = Snowflake.FromDate(after)
}.ExecuteAsync(new FakeConsole());
var data = await File.ReadAllTextAsync(filePath);
var document = Json.Parse(data);
var timestamps = document
// Assert
var timestamps = Json
.Parse(await File.ReadAllTextAsync(filePath))
.GetProperty("messages")
.EnumerateArray()
.Select(j => j.GetProperty("timestamp").GetDateTimeOffset())
.ToArray();
// Assert
timestamps.All(t => t < before && t > after).Should().BeTrue();
timestamps.Should().BeEquivalentTo(new[]