@@ -105,6 +105,55 @@ def test_breaking_change_in_footer(config):
105105 )
106106
107107
108+ @pytest .mark .parametrize (
109+ "scope,breaking_change_exclamation_in_title,expected_message" ,
110+ [
111+ # Test with scope and breaking_change_exclamation_in_title enabled
112+ (
113+ "users" ,
114+ True ,
115+ "feat(users)!: email pattern corrected\n \n complete content\n \n BREAKING CHANGE: migrate by renaming user to users" ,
116+ ),
117+ # Test without scope and breaking_change_exclamation_in_title enabled
118+ (
119+ "" ,
120+ True ,
121+ "feat!: email pattern corrected\n \n complete content\n \n BREAKING CHANGE: migrate by renaming user to users" ,
122+ ),
123+ # Test with scope and breaking_change_exclamation_in_title disabled
124+ (
125+ "users" ,
126+ False ,
127+ "feat(users): email pattern corrected\n \n complete content\n \n BREAKING CHANGE: migrate by renaming user to users" ,
128+ ),
129+ # Test without scope and breaking_change_exclamation_in_title disabled
130+ (
131+ "" ,
132+ False ,
133+ "feat: email pattern corrected\n \n complete content\n \n BREAKING CHANGE: migrate by renaming user to users" ,
134+ ),
135+ ],
136+ )
137+ def test_breaking_change_message_formats (
138+ config , scope , breaking_change_exclamation_in_title , expected_message
139+ ):
140+ # Set the breaking_change_exclamation_in_title setting
141+ config .settings ["breaking_change_exclamation_in_title" ] = (
142+ breaking_change_exclamation_in_title
143+ )
144+ conventional_commits = ConventionalCommitsCz (config )
145+ answers = {
146+ "prefix" : "feat" ,
147+ "scope" : scope ,
148+ "subject" : "email pattern corrected" ,
149+ "is_breaking_change" : True ,
150+ "body" : "complete content" ,
151+ "footer" : "migrate by renaming user to users" ,
152+ }
153+ message = conventional_commits .message (answers )
154+ assert message == expected_message
155+
156+
108157def test_example (config ):
109158 """just testing a string is returned. not the content"""
110159 conventional_commits = ConventionalCommitsCz (config )
0 commit comments