@@ -11,12 +11,14 @@ class TestParseNotesField:
1111
1212 def test_parse_complete_notes (self ):
1313 """Test parsing a complete notes field with all fields."""
14- notes = """Performance Rating: 125.5%
15- Justification: Great performance, delivered feature X, Y and Z. Role model to the team.
16- Mentor: Alice Chen
17- Mentees: Bob Jones, Carol White
18- Strengths: Customer Obsession, Ownership, Bias for Action
19- Areas for Improvement: Earn Trust, Dive Deep"""
14+ notes = """[Performance Rating: 125.5%]
15+ [Strengths: Customer Obsession, Ownership, Bias for Action]
16+ [Improvements: Earn Trust, Dive Deep]
17+ [Mentor: Alice Chen]
18+ [Mentees: Bob Jones, Carol White]
19+
20+ Justification:
21+ Great performance, delivered feature X, Y and Z. Role model to the team."""
2022
2123 result = parse_notes_field (notes )
2224
@@ -29,7 +31,7 @@ def test_parse_complete_notes(self):
2931
3032 def test_parse_rating_only (self ):
3133 """Test parsing notes with only performance rating."""
32- notes = "Performance Rating: 100%"
34+ notes = "[ Performance Rating: 100%] "
3335
3436 result = parse_notes_field (notes )
3537
@@ -42,11 +44,13 @@ def test_parse_rating_only(self):
4244
4345 def test_parse_multiline_justification (self ):
4446 """Test parsing multi-line justification text."""
45- notes = """Performance Rating: 130%
46- Justification: This employee demonstrated exceptional performance.
47+ notes = """[Performance Rating: 130%]
48+ [Mentor: Senior Dev]
49+
50+ Justification:
51+ This employee demonstrated exceptional performance.
4752They led the API redesign project which reduced latency by 40%.
48- Additionally, they mentored two junior engineers.
49- Mentor: Senior Dev"""
53+ Additionally, they mentored two junior engineers."""
5054
5155 result = parse_notes_field (notes )
5256
@@ -76,10 +80,12 @@ def test_parse_none_notes(self):
7680
7781 def test_parse_case_insensitive (self ):
7882 """Test that field names are case-insensitive."""
79- notes = """PERFORMANCE RATING: 110%
80- justification: good work
81- MENTOR: Boss
82- strengths: Leadership"""
83+ notes = """[PERFORMANCE RATING: 110%]
84+ [MENTOR: Boss]
85+ [STRENGTHS: Leadership]
86+
87+ Justification:
88+ good work"""
8389
8490 result = parse_notes_field (notes )
8591
@@ -90,37 +96,28 @@ def test_parse_case_insensitive(self):
9096
9197 def test_parse_rating_with_decimal (self ):
9298 """Test parsing rating with decimal places."""
93- notes = "Performance Rating: 115.75%"
99+ notes = "[ Performance Rating: 115.75%] "
94100
95101 result = parse_notes_field (notes )
96102
97103 assert result ['performance_rating' ] == 115.75
98104
99105 def test_parse_without_rating (self ):
100106 """Test parsing notes without performance rating."""
101- notes = """Justification: Solid performance this period.
102- Strengths: Teamwork, Communication"""
107+ notes = """[Strengths: Teamwork, Communication]
108+
109+ Justification:
110+ Solid performance this period."""
103111
104112 result = parse_notes_field (notes )
105113
106114 assert result ['performance_rating' ] is None
107115 assert result ['justification' ] == "Solid performance this period."
108116 assert result ['tenets_strengths' ] == "Teamwork, Communication"
109117
110- def test_parse_alternate_improvement_phrasings (self ):
111- """Test parsing various phrasings for improvements."""
112- notes1 = "Improvements: Time Management"
113- notes2 = "Areas to Improve: Focus"
114-
115- result1 = parse_notes_field (notes1 )
116- result2 = parse_notes_field (notes2 )
117-
118- assert result1 ['tenets_improvements' ] == "Time Management"
119- assert result2 ['tenets_improvements' ] == "Focus"
120-
121118 def test_parse_windows_line_endings (self ):
122119 """Test parsing notes with Windows line endings."""
123- notes = "Performance Rating: 100%\r \n Justification: Test \r \n Mentor: Alice "
120+ notes = "[ Performance Rating: 100%] \r \n [Mentor: Alice] \r \n \r \n Justification: \r \n Test "
124121
125122 result = parse_notes_field (notes )
126123
@@ -130,12 +127,14 @@ def test_parse_windows_line_endings(self):
130127
131128 def test_parse_real_world_example (self ):
132129 """Test parsing a real-world example from the export page."""
133- notes = """Performance Rating: 155.0%
134- Justification: Great performance, delivered feature X, Y and Z. Role model to the team.
135- Mentor: Rhoda Map
136- Mentees: Mai Stone
137- Strengths: We Serve Our Customers, We Champion Ownership, We Start with Trust
138- Areas for Improvement: We Embrace Transparency, We Navigate Change with Resilience"""
130+ notes = """[Performance Rating: 155.0%]
131+ [Strengths: We Serve Our Customers, We Champion Ownership, We Start with Trust]
132+ [Improvements: We Embrace Transparency, We Navigate Change with Resilience]
133+ [Mentor: Rhoda Map]
134+ [Mentees: Mai Stone]
135+
136+ Justification:
137+ Great performance, delivered feature X, Y and Z. Role model to the team."""
139138
140139 result = parse_notes_field (notes )
141140
@@ -161,12 +160,14 @@ def test_format_complete_notes(self):
161160 tenets_improvements = "Communication"
162161 )
163162
164- assert "Performance Rating: 125.0%" in result
165- assert "Justification: Great work this quarter." in result
166- assert "Mentor: Alice" in result
167- assert "Mentees: Bob; Carol" in result # Normalized to semicolons
168- assert "Strengths: Leadership, Teamwork" in result
169- assert "Areas for Improvement: Communication" in result
163+ assert "[Performance Rating: 125.0%]" in result
164+ assert "[Mentor: Alice]" in result
165+ assert "[Mentees: Bob; Carol]" in result # Normalized to semicolons
166+ assert "[Strengths: Leadership, Teamwork]" in result
167+ assert "[Improvements: Communication]" in result
168+ # Justification uses section header format
169+ assert "Justification:" in result
170+ assert "Great work this quarter." in result
170171
171172 def test_format_partial_notes (self ):
172173 """Test formatting with only some fields."""
@@ -175,10 +176,11 @@ def test_format_partial_notes(self):
175176 justification = "Met expectations."
176177 )
177178
178- assert "Performance Rating: 100.0%" in result
179- assert "Justification: Met expectations." in result
180- assert "Mentor:" not in result
181- assert "Strengths:" not in result
179+ assert "[Performance Rating: 100.0%]" in result
180+ assert "Justification:" in result
181+ assert "Met expectations." in result
182+ assert "[Mentor:" not in result
183+ assert "[Strengths:" not in result
182184
183185 def test_format_empty_notes (self ):
184186 """Test formatting with no fields returns empty string."""
@@ -279,7 +281,7 @@ def test_format_with_override(self):
279281 justification = "Pro-rata bonus"
280282 )
281283
282- assert "Performance Rating: 100.0%" in result
284+ assert "[ Performance Rating: 100.0%] " in result
283285 assert "[Override: 50.0%, Paternity leave Apr-Sep]" in result
284286 assert "Justification:" in result
285287 assert "Pro-rata bonus" in result
@@ -303,7 +305,7 @@ def test_format_no_override(self):
303305 )
304306
305307 assert "[Override:" not in result
306- assert "Performance Rating: 100.0%" in result
308+ assert "[ Performance Rating: 100.0%] " in result
307309
308310 def test_override_roundtrip (self ):
309311 """Test that formatting then parsing returns original override values."""
0 commit comments