Created
March 13, 2018 11:21
-
-
Save pranavgore09/7d428b0c5bae7ddcc537c02e216bb41f to your computer and use it in GitHub Desktop.
test case for `Check that already imported space template upon new import doesn't change the types of it's fields.` mentioned in https://github.com/fabric8-services/fabric8-wit/pull/1148
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| t.Run("import existing template with WIT field type changes", func(t *testing.T) { | |
| // Create fresh template | |
| spaceTemplateID := uuid.NewV4() | |
| witID := uuid.NewV4() | |
| wiltID := uuid.NewV4() | |
| witgID := uuid.NewV4() | |
| oldTempl := getValidTestTemplateParsed(t, spaceTemplateID, witID, wiltID, witgID) | |
| oldTempl.Template.Name = "old name for space template " + spaceTemplateID.String() | |
| _, err := s.importerRepo.Import(s.Ctx, oldTempl) | |
| require.NoError(t, err) | |
| // Import it once more but this time with changes | |
| templ := getValidTestTemplateParsed(t, spaceTemplateID, witID, wiltID, witgID) | |
| templ.WITs[0].Fields["title"] = workitem.FieldDefinition{ | |
| Label: "Title", | |
| Description: "The title of the bug", | |
| Required: true, | |
| Type: workitem.SimpleType{ | |
| Kind: workitem.KindInteger, | |
| }, | |
| } | |
| // when | |
| _, err = s.importerRepo.Import(s.Ctx, templ) | |
| // then | |
| require.Error(t, err) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment