#feature: add test mail generator
This commit is contained in:
@@ -195,6 +195,57 @@ class JiraServiceTest extends TestCase
|
||||
$this->assertEquals('十月中需求', $result);
|
||||
}
|
||||
|
||||
public function test_resolve_test_mail_sprint_period_normalizes_sprint_name()
|
||||
{
|
||||
$result = $this->jiraService->resolveTestMailSprintPeriod('CRM2603中迭代');
|
||||
|
||||
$this->assertEquals('Sprint2603月中', $result);
|
||||
}
|
||||
|
||||
public function test_resolve_test_mail_sprint_period_uses_issue_sprint_name()
|
||||
{
|
||||
$issues = collect([
|
||||
['sprint' => 'CRM2605底迭代'],
|
||||
]);
|
||||
|
||||
$result = $this->jiraService->resolveTestMailSprintPeriod('2324', $issues);
|
||||
|
||||
$this->assertEquals('Sprint2605月底', $result);
|
||||
}
|
||||
|
||||
public function test_resolve_test_mail_sprint_period_handles_year_month_name()
|
||||
{
|
||||
$result = $this->jiraService->resolveTestMailSprintPeriod('2026年5月中需求');
|
||||
|
||||
$this->assertEquals('Sprint2605月中', $result);
|
||||
}
|
||||
|
||||
public function test_estimated_test_at_field_name_does_not_match_actual_test_at()
|
||||
{
|
||||
$reflection = new \ReflectionClass($this->jiraService);
|
||||
$method = $reflection->getMethod('isEstimatedTestAtFieldName');
|
||||
|
||||
$this->assertFalse($method->invoke($this->jiraService, '实际提测时间'));
|
||||
$this->assertTrue($method->invoke($this->jiraService, '预计提测时间'));
|
||||
}
|
||||
|
||||
public function test_next_test_mail_version_increments_second_segment()
|
||||
{
|
||||
$reflection = new \ReflectionClass($this->jiraService);
|
||||
$method = $reflection->getMethod('nextTestMailVersion');
|
||||
|
||||
$this->assertEquals('2.70.0.0', $method->invoke($this->jiraService, '2.69.0.0'));
|
||||
}
|
||||
|
||||
public function test_test_mail_template_defaults_use_next_versions()
|
||||
{
|
||||
$defaults = $this->jiraService->getTestMailTemplateDefaults();
|
||||
|
||||
$this->assertEquals('2.70.0.0', $defaults['container_groups']['agent']['default_version']);
|
||||
$this->assertEquals('2.65.0.0', $defaults['container_groups']['portal']['default_version']);
|
||||
$this->assertEquals('1.43.0.0', $defaults['container_groups']['portal-ticket']['default_version']);
|
||||
}
|
||||
|
||||
public function test_extract_bug_stage_from_labels()
|
||||
{
|
||||
$reflection = new \ReflectionClass($this->jiraService);
|
||||
|
||||
Reference in New Issue
Block a user