{"size": 673, "ext": "js", "max_stars_repo_path": "api_server/modules/streams/test/post_stream/name_required_test.js", "max_stars_repo_name": "reneelpetit/codestream-server", "max_stars_repo_stars_event_min_datetime": "2021-01-22T19:38:12.000Z", "max_stars_repo_stars_event_max_datetime": "2021-01-22T19:38:12.000Z", "max_issues_repo_path": "api_server/modules/streams/test/post_stream/name_required_test.js", "max_issues_repo_name": "reneelpetit/codestream-server", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "api_server/modules/streams/test/post_stream/name_required_test.js", "max_forks_repo_name": "reneelpetit/codestream-server", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.03125, "max_line_length": 106, "alphanum_fraction": 0.6849925706}
'use strict';

const PostChannelStreamTest = require('./post_channel_stream_test');

class NameRequiredTest extends PostChannelStreamTest {

	get description () {
		return 'should return an error when attempting to create a channel stream with no name';
	}

	getExpectedError () {
		return {
			code: 'RAPI-1005',
			info: {
				code: 'STRM-1001'
			}
		};
	}

	// before the test runs...
	before (callback) {
		// set up standard test conditions for creating a channel stream, but remove the name, which is required
		super.before(error => {
			if (error) { return callback(error); }
			delete this.data.name;
			callback();
		});
	}
}

module.exports = NameRequiredTest;
