Skip to content

Commit 54943a4

Browse files
authored
Merge pull request #7 from rulasg/improve-convert-meeting-memebers
refactor(members): rename function and enhance company header
2 parents c71e93f + 412e2be commit 54943a4

2 files changed

Lines changed: 23 additions & 22 deletions

File tree

Test/public/convertMeetingMembersToMarkdown.test.ps1

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ function Test_ConvertMeetingMembersToMarkdown_SingleCompany {
44
$input = "Alice Johnson <alice.johnson@alphatech.com>, `"Bob Smith (AlphaTech)`" <bob.smith@alphatech.com>"
55

66
# Act
7-
$result = Convert-MeetingMembersToMarkdown -MeetingMembers $input
7+
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $input
88

99
# Assert
1010
$expected = @"
11-
- Alphatech
11+
- Alphatech (2)
1212
- Alice Johnson <alice.johnson@alphatech.com>
1313
- "Bob Smith (AlphaTech)" <bob.smith@alphatech.com>
1414
"@
@@ -21,16 +21,16 @@ function Test_ConvertMeetingMembersToMarkdown_MultipleCompanies {
2121
$input = "Alice Johnson <alice.johnson@alphatech.com>, `"Bob Smith (AlphaTech)`" <bob.smith@alphatech.com>, Alice Johnson <alice.johnson@betasoft.com>, `"Charlie Brown, David`" <charlie.brown@gammatech.com>, `"Emma Wilson, Frank`" <emma.wilson@gammatech.com>, `"Grace Lee, Henry`" <grace.lee@gammatech.com>"
2222

2323
# Act
24-
$result = Convert-MeetingMembersToMarkdown -MeetingMembers $input
24+
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $input
2525

2626
# Assert
2727
$expected = @"
28-
- Alphatech
28+
- Alphatech (2)
2929
- Alice Johnson <alice.johnson@alphatech.com>
3030
- "Bob Smith (AlphaTech)" <bob.smith@alphatech.com>
31-
- Betasoft
31+
- Betasoft (1)
3232
- Alice Johnson <alice.johnson@betasoft.com>
33-
- Gammatech
33+
- Gammatech (3)
3434
- "Charlie Brown, David" <charlie.brown@gammatech.com>
3535
- "Emma Wilson, Frank" <emma.wilson@gammatech.com>
3636
- "Grace Lee, Henry" <grace.lee@gammatech.com>
@@ -44,14 +44,14 @@ function Test_ConvertMeetingMembersToMarkdown_DuplicateMemberDifferentCompanies
4444
$input = "Alice Johnson <alice.johnson@alphatech.com>, Alice Johnson <alice.johnson@betasoft.com>"
4545

4646
# Act
47-
$result = Convert-MeetingMembersToMarkdown -MeetingMembers $input
47+
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $input
4848

4949
# Assert
5050
# Same person with different emails should appear in both company groups
5151
$expected = @"
52-
- Alphatech
52+
- Alphatech (1)
5353
- Alice Johnson <alice.johnson@alphatech.com>
54-
- Betasoft
54+
- Betasoft (1)
5555
- Alice Johnson <alice.johnson@betasoft.com>
5656
"@
5757
Assert-AreEqual -Expected $expected -Presented $result -Comment "Same person with different emails should appear in both companies"
@@ -63,14 +63,14 @@ function Test_ConvertMeetingMembersToMarkdown_SpecialCharactersInName {
6363
$input = "`"Bob Smith (AlphaTech)`" <bob.smith@alphatech.com>, `"Charlie Brown, David`" <charlie.brown@gammatech.com>"
6464

6565
# Act
66-
$result = Convert-MeetingMembersToMarkdown -MeetingMembers $input
66+
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $input
6767

6868
# Assert
6969
# Names with special characters (parentheses, commas) should be preserved
7070
$expected = @"
71-
- Alphatech
71+
- Alphatech (1)
7272
- "Bob Smith (AlphaTech)" <bob.smith@alphatech.com>
73-
- Gammatech
73+
- Gammatech (1)
7474
- "Charlie Brown, David" <charlie.brown@gammatech.com>
7575
"@
7676
Assert-AreEqual -Expected $expected -Presented $result -Comment "Names with special characters should be preserved"
@@ -82,7 +82,7 @@ function Test_ConvertMeetingMembersToMarkdown_EmptyInput {
8282
$input = ""
8383

8484
# Act
85-
$result = Convert-MeetingMembersToMarkdown -MeetingMembers $input
85+
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $input
8686

8787
# Assert
8888
Assert-AreEqual -Expected "" -Presented $result -Comment "Empty input should return empty string"
@@ -94,7 +94,7 @@ function Test_ConvertMeetingMembersToMarkdown_WhitespaceOnlyInput {
9494
$input = " "
9595

9696
# Act
97-
$result = Convert-MeetingMembersToMarkdown -MeetingMembers $input
97+
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $input
9898

9999
# Assert
100100
Assert-AreEqual -Expected "" -Presented $result -Comment "Whitespace-only input should return empty string"
@@ -106,11 +106,11 @@ function Test_ConvertMeetingMembersToMarkdown_SingleMember {
106106
$input = "John Doe <john.doe@example.com>"
107107

108108
# Act
109-
$result = Convert-MeetingMembersToMarkdown -MeetingMembers $input
109+
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $input
110110

111111
# Assert
112112
$expected = @"
113-
- Example
113+
- Example (1)
114114
- John Doe <john.doe@example.com>
115115
"@
116116
Assert-AreEqual -Expected $expected -Presented $result -Comment "Single member should work correctly"
@@ -122,16 +122,16 @@ function Test_ConvertMeetingsMembersToMarkdown_Big_sample{
122122
"Alice Anderson" <alice.anderson@deltalab.com>, "Amy Adams (She/Her)" <amy.adams@betasoft.com>, "Bob Brown" <bob.brown@betasoft.com>, "Charlie Chen" <charlie.chen@betasoft.com>, david.davis@betasoft.com, "David Dennis" <david.dennis@betasoft.com>, "Emma Evans, Eric" <emma.evans@deltalab.com>, emma.edwards@betasoft.com, "Frank Fields, Fiona" <frank.fields@deltalab.com>, george.garcia@bookings.betasoft.com, george.garcia@betasoft.com, "Grace (AlphaTech) Garcia" <grace.garcia@alphatech.com>, "Henry Harris" <henry.harris@alphatech.com>, "Iris Ingram" <iris.ingram@betasoft.com>, "Jack Johnson" <jack.johnson@betasoft.com>, "James Jackson" <james.jackson@betasoft.com>, "Jennifer Jones" <jennifer.jones@betasoft.com>, "Kevin Kim" <kevin.kim@alphatech.com>, "Kyle Knight" <kyle.knight@betasoft.com>, lisa.lee@betasoft.com, "Laura Lewis" <laura.lewis@alphatech.com>, "Mark Martinez" <mark.martinez@alphatech.com>
123123
"@
124124

125-
$result = Convert-MeetingMembersToMarkdown -MeetingMembers $imput
125+
$result = Convert-NotesMeetingMembersToMarkdown -MeetingMembers $imput
126126

127127
Assert-AreEqual -Presented $result -Expected @"
128-
- Alphatech
128+
- Alphatech (5)
129129
- "Grace (AlphaTech) Garcia" <grace.garcia@alphatech.com>
130130
- "Henry Harris" <henry.harris@alphatech.com>
131131
- "Kevin Kim" <kevin.kim@alphatech.com>
132132
- "Laura Lewis" <laura.lewis@alphatech.com>
133133
- "Mark Martinez" <mark.martinez@alphatech.com>
134-
- Betasoft
134+
- Betasoft (9)
135135
- "Amy Adams (She/Her)" <amy.adams@betasoft.com>
136136
- "Bob Brown" <bob.brown@betasoft.com>
137137
- "Charlie Chen" <charlie.chen@betasoft.com>
@@ -141,7 +141,7 @@ function Test_ConvertMeetingsMembersToMarkdown_Big_sample{
141141
- "James Jackson" <james.jackson@betasoft.com>
142142
- "Jennifer Jones" <jennifer.jones@betasoft.com>
143143
- "Kyle Knight" <kyle.knight@betasoft.com>
144-
- Deltalab
144+
- Deltalab (3)
145145
- "Alice Anderson" <alice.anderson@deltalab.com>
146146
- "Emma Evans, Eric" <emma.evans@deltalab.com>
147147
- "Frank Fields, Fiona" <frank.fields@deltalab.com>

private/parseMemberEmail.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ function groupMembersByCompany {
6868
$result = @()
6969

7070
foreach ($group in $grouped) {
71-
# Add company header
72-
$result += "- $($group.Name)"
71+
# Add company header with member count
72+
$memberCount = $group.Group.Count
73+
$result += "- $($group.Name) ($memberCount)"
7374

7475
# Add members with 4-space indentation
7576
foreach ($member in $group.Group) {

0 commit comments

Comments
 (0)