// handle unit tests for the "PUT /codemarks" request to update a knowledge base codemark

'use strict';

const PutCodemarkTest = require('./put_codemark_test');
const SetPostIdTest = require('./set_post_id_test');
const ACLTest = require('./acl_test');
const ACLTeamTest = require('./acl_team_test');
const CodemarkNotFoundTest = require('./codemark_not_found_test');
const PutCodemarkFetchTest = require('./put_codemark_fetch_test');
const NoUpdateOtherAttributeTest = require('./no_update_other_attribute_test');
const NoUpdatePostIdTest = require('./no_update_post_id_test');
const StreamIdRequiredTest = require('./stream_id_required_test');
const NoStreamIdTest = require('./no_stream_id_test');
const MessageTest = require('./message_test');
const ProviderTypeMessageTest = require('./provider_type_message_test');
const UpdateMarkerTest = require('./update_marker_test');
const UpdateMarkerFetchTest = require('./update_marker_fetch_test');
const UpdateMarkerMessageTest = require('./update_marker_message_test');
const RequiredForTypeTest = require('./required_for_type_test');
const SetAssigneesTest = require('./set_assignees_test');
const ClearAssigneesTest = require('./clear_assignees_test');
const InvalidAssigneeTest = require('./invalid_assignee_test');
const AssigneeNotOnTeamTest = require('./assignee_not_on_team_test');
const AssigneesIgnoredTest = require('./assignees_ignored_test');
const SetPostlessAssigneesTest = require('./set_postless_assignees_test');
const UpdatePostlessAssigneesTest = require('./update_postless_assignees_test');
const SetParentPostIdTest = require('./set_parent_post_id_test');
const TeamMemberUpdateIssueStatusTest = require('./team_member_update_issue_status_test');
const UpdateStatusACLTest = require('./update_status_acl_test');
const TagsTest = require('./tags_test');
const OtherUserCanAddTagsTest = require('./other_user_can_add_tags_test');
const TagNotFoundTest = require('./tag_not_found_test');
const TagDeactivatedTest = require('./tag_deactivated_test');
const RelatedCodemarksTest = require('./related_codemarks_test');
const RelatedCodemarksFetchTest = require('./related_codemarks_fetch_test');
const RelatedCodemarkNotFoundTest = require('./related_codemark_not_found_test');
const RelatedCodemarkACLTest = require('./related_codemark_acl_test');
const RelatedCodemarksDifferentTeamTest = require('./related_codemarks_different_team_test');
const AddRelatedCodemarksTest = require('./add_related_codemarks_test');
const AddRelatedCodemarksFetchTest = require('./add_related_codemarks_fetch_test');
const RemoveRelatedCodemarksTest = require('./remove_related_codemarks_test');
const RemoveRelatedCodemarksFetchTest = require('./remove_related_codemarks_fetch_test');
const RelatedCodemarksMessageTest = require('./related_codemarks_message_test');
const AddRelatedCodemarksMessageTest = require('./add_related_codemarks_message_test');
const RemoveRelatedCodemarksMessageTest = require('./remove_related_codemarks_message_test');
const ColorBecomesTagTest = require('./color_becomes_tag_test');
const SetExternalProviderTest = require('./set_external_provider_test');
const SetExternalAssigneesTest = require('./set_external_assignees_test');
const SetUrlsTest = require('./set_urls_test');
const SetCodeStreamPostIdTest = require('./set_codestream_post_id_test');
const PostNotFoundTest = require('./post_not_found_test');
const ACLPostTest = require('./acl_post_test');
const SetCodeStreamPostIdMarkersTest = require('./set_codestream_post_id_markers_test');
const PostDeactivatedTest = require('./post_deactivated_test');
const PostFromOtherTeamTest = require('./post_from_other_team_test');
const IgnoreStreamIdTest = require('./ignore_stream_id_test');
const LinkPostMessageTest = require('./link_post_message_test');
const RemovedMemberCantUpdateTest = require('./removed_member_cant_update_test');

class PutCodemarkRequestTester {

	test () {
		new PutCodemarkTest().test();
		new SetPostIdTest().test();
		new ACLTest().test();
		new ACLTeamTest().test();
		new CodemarkNotFoundTest().test();
		new PutCodemarkFetchTest().test();
		new NoUpdateOtherAttributeTest({ attribute: 'type' }).test();
		new NoUpdateOtherAttributeTest({ attribute: 'markerIds' }).test();
		new NoUpdateOtherAttributeTest({ attribute: 'teamId' }).test();
		new NoUpdateOtherAttributeTest({ attribute: 'providerType' }).test();
		new NoUpdateOtherAttributeTest({ attribute: 'parentPostId' }).test();
		new NoUpdatePostIdTest().test();
		new StreamIdRequiredTest().test();
		new NoStreamIdTest().test();
		new MessageTest().test();
		new ProviderTypeMessageTest().test();
		// NOTE posting to streams other than the team stream is no longer allowed
		//new MessageTest({ streamType: 'channel' }).test();
		//new MessageTest({ streamType: 'direct' }).test();
		//new MessageTest({ streamType: 'team stream' }).test();
		//new ProviderTypeMessageTest({ streamType: 'channel' }).test();
		//new ProviderTypeMessageTest({ streamType: 'direct' }).test();
		//new ProviderTypeMessageTest({ streamType: 'team stream' }).test();
		new UpdateMarkerTest().test();
		new UpdateMarkerFetchTest().test();
		new UpdateMarkerMessageTest().test();
		// NOTE posting to streams other than the team stream is no longer allowed
		//new UpdateMarkerMessageTest({ streamType: 'channel' }).test();
		//new UpdateMarkerMessageTest({ streamType: 'direct' }).test();
		//new UpdateMarkerMessageTest({ streamType: 'team stream' }).test();
		new RequiredForTypeTest({ codemarkType: 'comment', attribute: 'text' }).test();
		new RequiredForTypeTest({ codemarkType: 'bookmark', attribute: 'title', wantMarker: true }).test();
		new RequiredForTypeTest({ codemarkType: 'trap', attribute: 'text', wantMarker: true }).test();
		new RequiredForTypeTest({ codemarkType: 'question', attribute: 'title' }).test();
		new RequiredForTypeTest({ codemarkType: 'issue', attribute: 'title' }).test();
		new SetAssigneesTest().test();
		new ClearAssigneesTest().test();
		new InvalidAssigneeTest().test();
		new AssigneeNotOnTeamTest().test();
		new AssigneesIgnoredTest().test();
		new SetPostlessAssigneesTest().test();
		new UpdatePostlessAssigneesTest().test();
		new SetParentPostIdTest().test();
		new TeamMemberUpdateIssueStatusTest().test();
		new UpdateStatusACLTest().test();
		new TagsTest().test();
		new OtherUserCanAddTagsTest().test();
		new TagNotFoundTest().test();
		new TagDeactivatedTest().test();
		new RelatedCodemarksTest().test();
		new RelatedCodemarksFetchTest().test();
		new RelatedCodemarkNotFoundTest().test();
		new RelatedCodemarkACLTest().test();
		new RelatedCodemarksDifferentTeamTest().test();
		new AddRelatedCodemarksTest().test();
		new AddRelatedCodemarksFetchTest().test();
		new RemoveRelatedCodemarksTest().test();
		new RemoveRelatedCodemarksFetchTest().test();
		new RelatedCodemarksMessageTest().test();
		new AddRelatedCodemarksMessageTest().test();
		new RemoveRelatedCodemarksMessageTest().test();
		new ColorBecomesTagTest().test();
		new SetExternalProviderTest().test();
		new SetExternalAssigneesTest().test();
		new SetUrlsTest().test();
		new SetCodeStreamPostIdTest().test();
		new PostNotFoundTest().test();
		new ACLPostTest().test();
		new SetCodeStreamPostIdMarkersTest().test();
		new PostDeactivatedTest().test();
		new PostFromOtherTeamTest().test();
		new IgnoreStreamIdTest().test();
		new LinkPostMessageTest().test();
		// NOTE posting to streams other than the team stream is no longer allowed
		//new LinkPostMessageTest({ streamType: 'channel' }).test();
		//new LinkPostMessageTest({ streamType: 'direct' }).test();
		//new LinkPostMessageTest({ streamType: 'team stream' }).test();
		new RemovedMemberCantUpdateTest().test();
	}
}

module.exports = new PutCodemarkRequestTester();
