Public Access
Add meeting inactivity safeguards
PR and Push Build/Test / build-and-test (push) Failing after 14m53s
PR and Push Build/Test / build-and-test (push) Failing after 14m53s
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
using MeetingAssistant.MeetingNotes;
|
||||
using MeetingAssistant.Recording;
|
||||
|
||||
namespace MeetingAssistant.Tests;
|
||||
|
||||
public sealed class MeetingArtifactContentDetectorTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task IsDefaultOnlyReturnsFalseWhenTranscriptContainsSegment()
|
||||
{
|
||||
using var fixture = await DefaultArtifactFixture.CreateAsync();
|
||||
await File.AppendAllTextAsync(
|
||||
fixture.Artifacts.TranscriptPath,
|
||||
"[00:00:01] Guest-1: hello" + Environment.NewLine);
|
||||
|
||||
var result = await MeetingArtifactContentDetector.IsDefaultOnlyAsync(
|
||||
fixture.Artifacts,
|
||||
CancellationToken.None);
|
||||
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task IsDefaultOnlyReturnsFalseWhenMeetingNoteContainsUserNotes()
|
||||
{
|
||||
using var fixture = await DefaultArtifactFixture.CreateAsync();
|
||||
await File.AppendAllTextAsync(
|
||||
fixture.Artifacts.MeetingNotePath,
|
||||
"Manual note" + Environment.NewLine);
|
||||
|
||||
var result = await MeetingArtifactContentDetector.IsDefaultOnlyAsync(
|
||||
fixture.Artifacts,
|
||||
CancellationToken.None);
|
||||
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
private sealed class DefaultArtifactFixture : IDisposable
|
||||
{
|
||||
private DefaultArtifactFixture(string root, MeetingSessionArtifacts artifacts)
|
||||
{
|
||||
Root = root;
|
||||
Artifacts = artifacts;
|
||||
}
|
||||
|
||||
public string Root { get; }
|
||||
|
||||
public MeetingSessionArtifacts Artifacts { get; }
|
||||
|
||||
public static async Task<DefaultArtifactFixture> CreateAsync()
|
||||
{
|
||||
var root = Path.Combine(Path.GetTempPath(), "meeting-assistant-tests", Guid.NewGuid().ToString("N"));
|
||||
Directory.CreateDirectory(root);
|
||||
var artifacts = new MeetingSessionArtifacts(
|
||||
Path.Combine(root, "meeting.md"),
|
||||
Path.Combine(root, "transcript.md"),
|
||||
Path.Combine(root, "assistant-context.md"),
|
||||
Path.Combine(root, "summary.md"));
|
||||
await File.WriteAllTextAsync(
|
||||
artifacts.MeetingNotePath,
|
||||
"""
|
||||
---
|
||||
title: Test
|
||||
---
|
||||
|
||||
""");
|
||||
await File.WriteAllTextAsync(
|
||||
artifacts.TranscriptPath,
|
||||
"# Meeting Transcript" + Environment.NewLine + Environment.NewLine);
|
||||
await File.WriteAllTextAsync(
|
||||
artifacts.AssistantContextPath,
|
||||
"# Assistant Context" + Environment.NewLine + Environment.NewLine + "## Live Context" + Environment.NewLine);
|
||||
|
||||
return new DefaultArtifactFixture(root, artifacts);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (Directory.Exists(Root))
|
||||
{
|
||||
Directory.Delete(Root, recursive: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user