Ejemplo n.º 1
0
	Cohort.create( o, function onCreate( err, createdCohort ) {
		t.strictEqual( err instanceof Error, false, 'does not return an error' );
		t.strictEqual( createdCohort.title, 'boop', 'has correct title' );
		t.ok( isEmptyArray( createdCohort.members ), 'has no members' );
		t.strictEqual( createdCohort.startDate, startDate, 'has correct start date' );
		t.strictEqual( createdCohort.endDate, endDate, 'has correct end date' );
		t.end();
	});
Ejemplo n.º 2
0
	Cohort.create( o, function onCreate( err, createdCohort ) {
		var tdiff;
		t.strictEqual( err instanceof Error, false, 'does not return an error' );
		t.strictEqual( createdCohort.title, 'beep', 'has correct title' );
		t.ok( isEmptyArray( createdCohort.members ), 'has no members' );
		t.ok( isDateObject( createdCohort.startDate ), 'has a start date' );
		tdiff = abs( createdCohort.startDate.getTime() - new Date().getTime() );
		t.ok( tdiff < 60000, 'start date is smaller than latency' );
		t.end();
	});
Ejemplo n.º 3
0
	renderChart() {
		const { data } = this.state;
		if ( isEmptyArray( data ) ) {
			return <h3>No responses yet</h3>;
		}
		return ( <VictoryChart width={350} height={200} domainPadding={20} domain={{ y: [ 0, 20 ]}} >
			<VictoryArea
				data={data.length > 2 ? getBins( data ) : []}
				interpolation="step"
			/>
			<VictoryAxis
				label="Answer"
			/>
			<VictoryAxis
				dependentAxis
				label="Count"
			/>
		</VictoryChart> );
	}
Ejemplo n.º 4
0
	renderChart() {
		if ( isEmptyArray( this.state.data ) ) {
			return (
				<h3>No responses yet</h3>
			);
		}
		return ( <VictoryChart width={350} height={200} domainPadding={20} domain={{ y: [ 0, 20 ]}} >
			<VictoryAxis
				tickLabelComponent={
					<VictoryLabel angle={90} />
				}
			/>
			<VictoryAxis dependentAxis />
			<VictoryBar
				data={this.state.data}
				x="x"
				y="y"
			/>
		</VictoryChart> );
	}