feat(bot): add online/offline wizard locations
PR Checks / test-and-build (pull_request) Successful in 15m52s
PR Checks / test-and-build (pull_request) Successful in 15m52s
Add format and location steps to the Telegram /newsession wizard, persist offline addresses in sessions.location_address, and render online links/offline addresses in schedule messages. Bump version to 3.10.0.
This commit is contained in:
@@ -135,6 +135,56 @@ public sealed class TelegramSessionBatchRendererTests
|
||||
Assert.Equal(2, buttons.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Render_ShouldShowOfflineAddress()
|
||||
{
|
||||
var sessionId = Guid.NewGuid();
|
||||
var sessions = new[]
|
||||
{
|
||||
new SessionBatchDto(
|
||||
sessionId,
|
||||
DateTime.UtcNow,
|
||||
SessionStatus.Planned,
|
||||
4,
|
||||
"",
|
||||
"Offline",
|
||||
"Москва, ул. Кубиков, 12"),
|
||||
};
|
||||
var participants = Array.Empty<ParticipantBatchDto>();
|
||||
|
||||
var view = SessionBatchViewBuilder.Build("Offline Test", sessions, participants);
|
||||
var (text, _) = TelegramSessionBatchRenderer.Render(view);
|
||||
|
||||
Assert.Contains("📍 Адрес:", text);
|
||||
Assert.Contains("Москва, ул. Кубиков, 12", text);
|
||||
Assert.DoesNotContain("Ссылка на игру", text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Render_ShouldShowOnlineLinkWithLinkIcon()
|
||||
{
|
||||
var sessionId = Guid.NewGuid();
|
||||
var sessions = new[]
|
||||
{
|
||||
new SessionBatchDto(
|
||||
sessionId,
|
||||
DateTime.UtcNow,
|
||||
SessionStatus.Planned,
|
||||
4,
|
||||
"https://vtt.example/game",
|
||||
"Online",
|
||||
null),
|
||||
};
|
||||
var participants = Array.Empty<ParticipantBatchDto>();
|
||||
|
||||
var view = SessionBatchViewBuilder.Build("Online Test", sessions, participants);
|
||||
var (text, _) = TelegramSessionBatchRenderer.Render(view);
|
||||
|
||||
Assert.Contains("🔗 Ссылка на игру", text);
|
||||
Assert.Contains("https://vtt.example/game", text);
|
||||
Assert.DoesNotContain("📍 Адрес:", text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Render_ShouldEncodeHtmlInJoinLink()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user