Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 196 additions & 0 deletions Test/public/convertMeetingAttendeesToMarkdown.test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
function Test_ConvertMeetingAttendeesToMarkdown_EmptyInput {

# Arrange
$input = ""

# Act
$result = Convert-NotesMeetingAttendeesToMarkdown -MeetingAttendees $input

# Assert
Assert-AreEqual -Expected "" -Presented $result -Comment "Empty input should return empty string"
}

function Test_ConvertMeetingAttendeesToMarkdown_HeaderOnly {

# Arrange
$input = "Name`tAttendance`tResponse"

# Act
$result = Convert-NotesMeetingAttendeesToMarkdown -MeetingAttendees $input

# Assert
Assert-AreEqual -Expected "" -Presented $result -Comment "Header-only input should return empty string"
}

function Test_ConvertMeetingAttendeesToMarkdown_SingleAttendee {

# Arrange
$input = @"
Name`tAttendance`tResponse
André Müller <[email protected]>`tRequired`tAccepted
"@

# Act
$result = Convert-NotesMeetingAttendeesToMarkdown -MeetingAttendees $input

# Assert
$expected = @'
- Devtools (1)
- ✅R André Müller <[email protected]>
'@
Assert-AreEqual -Expected $expected -Presented $result -Comment "Single attendee should include attendance and response"
}

function Test_ConvertMeetingAttendeesToMarkdown_MultipleCompanies {

# Arrange
$input = @"
Name`tAttendance`tResponse
Alice Johnson <[email protected]>`tRequired`tAccepted
Bob Smith <[email protected]>`tOptional`tDeclined
Charlie Chen <[email protected]>`tOptional`tAccepted
"@

# Act
$result = Convert-NotesMeetingAttendeesToMarkdown -MeetingAttendees $input

# Assert
$expected = @'
- Alphatech (2)
- ✅R Alice Johnson <[email protected]>
- ✅O Charlie Chen <[email protected]>
- Betasoft (1)
- ❎O Bob Smith <[email protected]>
'@
Assert-AreEqual -Expected $expected -Presented $result -Comment "Multiple companies should be sorted with attendance info"
}

function Test_ConvertMeetingAttendeesToMarkdown_AllCapsConversion {

# Arrange
$input = @"
Name`tAttendance`tResponse
ALICE JOHNSON <[email protected]>`tRequired`tAccepted
BOB SMITH <[email protected]>`tOptional`tAccepted
"@

# Act
$result = Convert-NotesMeetingAttendeesToMarkdown -MeetingAttendees $input

# Assert
$expected = @'
- Alphatech (1)
- ✅R Alice Johnson <[email protected]>
- Betasoft (1)
- ✅O Bob Smith <[email protected]>
'@
Assert-AreEqual -Expected $expected -Presented $result -Comment "ALL CAPS names should be converted to title case"
}

function Test_ConvertMeetingAttendeesToMarkdown_EmailOnlyFormat {

# Arrange
$input = @"
Name`tAttendance`tResponse
[email protected] <[email protected]>`tRequired`tAccepted
"@

# Act
$result = Convert-NotesMeetingAttendeesToMarkdown -MeetingAttendees $input

# Assert
$expected = @'
- Acmecorp (1)
- ✅R [email protected]
'@
Assert-AreEqual -Expected $expected -Presented $result -Comment "Email-only format should show email with attendance info"
}

function Test_ConvertMeetingAttendeesToMarkdown_SpaceSeparated {

# Arrange
$input = @"
Name Attendance Response
Alice Johnson <[email protected]> Required Accepted
Bob Smith <[email protected]> Optional Declined
"@

# Act
$result = Convert-NotesMeetingAttendeesToMarkdown -MeetingAttendees $input

# Assert
$expected = @'
- Alphatech (1)
- ✅R Alice Johnson <[email protected]>
- Betasoft (1)
- ❎O Bob Smith <[email protected]>
'@
Assert-AreEqual -Expected $expected -Presented $result -Comment "Space-separated fields should be parsed correctly"
}

function Test_ConvertMeetingAttendeesToMarkdown_NoSeparator {

# Arrange
$input = @"
NameAttendanceResponse
Alice Johnson <[email protected]>RequiredAccepted
Bob Smith <[email protected]>OptionalDeclined
"@

# Act
$result = Convert-NotesMeetingAttendeesToMarkdown -MeetingAttendees $input

# Assert
$expected = @'
- Alphatech (1)
- ✅R Alice Johnson <[email protected]>
- Betasoft (1)
- ❎O Bob Smith <[email protected]>
'@
Assert-AreEqual -Expected $expected -Presented $result -Comment "Concatenated fields with no separator should be parsed correctly"
}

function Test_ConvertMeetingAttendeesToMarkdown_BigSample {

# Arrange
$input = @"
Name`tAttendance`tResponse
André Müller <[email protected]>`tRequired`tAccepted
[email protected] <[email protected]>`tRequired`tAccepted
EMMA WATSON CLARK <[email protected]>`tRequired`tAccepted
Grace Kim <[email protected]>`tOptional`tAccepted
Helen de la Cruz Torres <[email protected]>`tOptional`tAccepted
FRANK MILLER THOMPSON <[email protected]>`tOptional`tAccepted
David Parker Lane <[email protected]>`tOptional`tFollowing
LAURA CHEN WANG <[email protected]>`tOptional`tDeclined
Mark Stevens (External Consulting LLC) <[email protected]>`tRequired`tDidn't respond
Nathan Brooks Wilson <[email protected]>`tOptional`tDidn't respond
PETER JONES GARCIA <[email protected]>`tOptional`tDidn't respond
SARAH TAYLOR RODRIGUEZ <[email protected]>`tOptional`tDidn't respond
René Dubois Martín <[email protected]>`tOptional`tDidn't respond
"@

# Act
$result = Convert-NotesMeetingAttendeesToMarkdown -MeetingAttendees $input

# Assert
$expected = @'
- Acmecorp (6)
- ✅R Emma Watson Clark <[email protected]>
- ✅R [email protected]
- ✅O Frank Miller Thompson <[email protected]>
- ❎O Laura Chen Wang <[email protected]>
- 🟩O Peter Jones Garcia <[email protected]>
- 🟩O Sarah Taylor Rodriguez <[email protected]>
- Cloudtech (5)
- ✅O Grace Kim <[email protected]>
- ✅O Helen de la Cruz Torres <[email protected]>
- 👀O David Parker Lane <[email protected]>
- 🟩O Nathan Brooks Wilson <[email protected]>
- 🟩O René Dubois Martín <[email protected]>
- Devtools (2)
- ✅R André Müller <[email protected]>
- ⭕️R Mark Stevens (External Consulting LLC) <[email protected]>
'@
Assert-AreEqual -Expected $expected -Presented $result -Comment "Big sample should match expected output with attendance and RSVP"
}
77 changes: 77 additions & 0 deletions Test/public/convertMeetingMembersToMarkdown.test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,83 @@ function Test_ConvertMeetingMembersToMarkdown_MixedEmailFormats {
}


function Test_ConvertMeetingMembersToMarkdown_OutlookFormat {

# Arrange - Outlook format with ALL CAPS names, email-only entries, and mixed case
$input = "ALICE JOHNSON <[email protected]>; BOB SMITH <[email protected]>; [email protected] <[email protected]>"

# Act
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $input

# Assert
$expected = @"
- Alphatech (1)
- Alice Johnson <[email protected]>
- Betasoft (1)
- Bob Smith <[email protected]>
- Gammatech (1)
- [email protected]
"@
Assert-AreEqual -Expected $expected -Presented $result -Comment "Outlook format should handle ALL CAPS, email-only, and mixed case entries"
}

function Test_ConvertMeetingMembersToMarkdown_OutlookResourceFiltering {

# Arrange
$input = "ALICE JOHNSON <[email protected]>; ES-Ciudad Room 101 <[email protected]>"

# Act
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $input

# Assert
$expected = @"
- Alphatech (1)
- Alice Johnson <[email protected]>
"@
Assert-AreEqual -Expected $expected -Presented $result -Comment "Resource/room entries should be filtered out"
}

function Test_ConvertMeetingMembersToMarkdown_OutlookMixedCasePreserved {

# Arrange - Mixed case names should NOT be converted
$input = "Vilanova Arnal, Juan <[email protected]>; Ricardo Sastre Martín <[email protected]>"

# Act
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $input

# Assert
$expected = @"
- Accenture (1)
- Vilanova Arnal, Juan <[email protected]>
- Microsoft (1)
- Ricardo Sastre Martín <[email protected]>
"@
Assert-AreEqual -Expected $expected -Presented $result -Comment "Mixed case names should be preserved as-is"
}

function Test_ConvertMeetingMembersToMarkdown_OutlookBigSample {

# Arrange
$input = "JUAN CARLOS OSORIO BARJOLA <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Vilanova Arnal, Juan <[email protected]>; ES-Room <[email protected]>; [email protected] <[email protected]>"

# Act
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $input

# Assert
$expected = @"
- Accenture (1)
- Vilanova Arnal, Juan <[email protected]>
- Bbva (2)
- Juan Carlos Osorio Barjola <[email protected]>
- [email protected]
- Github (1)
- [email protected]
- Microsoft (1)
- [email protected]
"@
Assert-AreEqual -Expected $expected -Presented $result -Comment "Outlook format with mixed entry types should work correctly"
}

function Test_ConvertMeetingsMembersToMarkdown_Big_sample{

$imput = @"
Expand Down
Loading
Loading