Skip to content

Instantly share code, notes, and snippets.

View enricopolanski's full-sized avatar

Enrico Polanski enricopolanski

View GitHub Profile
import StudiesObserver from './StudiesObserver';
beforeEach(()=> {
const studiesObserver = new StudiesObserver();
});
test('Changing the StudyBlock.status property should trigger update()', () => {
const spy = jest.spyOn(studiesObserver, 'update');
const isUpdating = studiesObserver.update();
expect(spy).toHaveBeenCalled();
changeDate(direction){
direction === 'next' ? this.dateTimeManager.setToNextDay() : this.dateTimeManager.setToPreviousDay();
}
import { bindings } from '../view/bindings';
class Controller {
constructor(userData, dateTimeManager, main, bindings){
/**/
this.bindings = bindings.bind(this);
}
addBindings(){
window.onclick = this.bindings;
> [email protected] build /mnt/c/Users/Aquazi/Desktop/tui
> webpack --watch
Webpack is watching the files…
Hash: e356bf01d0bfe3c154b7
Version: webpack 3.1.0
Time: 692ms
Asset Size Chunks Chunk Names
const path = require('path');
const productionConfig = merge([
parts.generateSourceMaps({ type: 'source-map' }),
]);
module.exports = {
entry: './src/app.js',
output: {
path: path.join(__dirname, 'public'),
days : {},
firstDay:"Mon May 14 2018 00:00:00 GMT+0200 (W. Europe Daylight Time)",
lastAccessDay:"Mon May 14 2018 00:00:00 GMT+0200 (W. Europe Daylight Time)",
topics:{},
totalSkipped:0,
totalStudied:0
Object.keys(UserData).forEach( key => { window.localStorage.setItem(key.toString(), UserData[key]); });
test('checks if C topic is in topics', () => {
expect(Object.keys(user.topics).toContain('C'));
});
export default class UserData {
constructor(days = {}, firstDay = getFirstDay(), lastAccessDay){
this.days = days;
this.firstDay = firstDay;
this.lastAccessDay = lastAccessDay;
}
static getFirstDay() {
return new Date();
}
render() {
const navbarElements = ["hello"];
return (
<div>
<p>Welcome to my App</p>
<Header navbarBelements={navbarElements} />
</div>
);
}