Skip to content

Commit efeac26

Browse files
Committed e2e and src folders
1 parent 1b3267f commit efeac26

19 files changed

+417
-0
lines changed

e2e/protractor.conf.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @ts-check
2+
// Protractor configuration file, see link for more information
3+
// https://github.com/angular/protractor/blob/master/lib/config.ts
4+
5+
const { SpecReporter } = require('jasmine-spec-reporter');
6+
7+
/**
8+
* @type { import("protractor").Config }
9+
*/
10+
exports.config = {
11+
allScriptsTimeout: 11000,
12+
specs: [
13+
'./src/**/*.e2e-spec.ts'
14+
],
15+
capabilities: {
16+
browserName: 'chrome'
17+
},
18+
directConnect: true,
19+
baseUrl: 'http://localhost:4200/',
20+
framework: 'jasmine',
21+
jasmineNodeOpts: {
22+
showColors: true,
23+
defaultTimeoutInterval: 30000,
24+
print: function() {}
25+
},
26+
onPrepare() {
27+
require('ts-node').register({
28+
project: require('path').join(__dirname, './tsconfig.json')
29+
});
30+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
31+
}
32+
};

e2e/src/app.e2e-spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AppPage } from './app.po';
2+
import { browser, logging } from 'protractor';
3+
4+
describe('workspace-project App', () => {
5+
let page: AppPage;
6+
7+
beforeEach(() => {
8+
page = new AppPage();
9+
});
10+
11+
it('should display welcome message', () => {
12+
page.navigateTo();
13+
expect(page.getTitleText()).toEqual('schedule-ang8 app is running!');
14+
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
22+
});
23+
});

e2e/src/app.po.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo() {
5+
return browser.get(browser.baseUrl) as Promise<any>;
6+
}
7+
8+
getTitleText() {
9+
return element(by.css('app-root .content span')).getText() as Promise<string>;
10+
}
11+
}

e2e/tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/e2e",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": [
8+
"jasmine",
9+
"jasminewd2",
10+
"node"
11+
]
12+
}
13+
}

src/app/app.component.css

Whitespace-only changes.

src/app/app.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<ejs-schedule width='100%' height='650px' [selectedDate]="selectedDate" [eventSettings]="eventSettings"
2+
[workDays]="getWorkDays()">
3+
</ejs-schedule>

src/app/app.component.spec.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { TestBed, async } from '@angular/core/testing';
2+
import { AppComponent } from './app.component';
3+
4+
describe('AppComponent', () => {
5+
beforeEach(async(() => {
6+
TestBed.configureTestingModule({
7+
declarations: [
8+
AppComponent
9+
],
10+
}).compileComponents();
11+
}));
12+
13+
it('should create the app', () => {
14+
const fixture = TestBed.createComponent(AppComponent);
15+
const app = fixture.debugElement.componentInstance;
16+
expect(app).toBeTruthy();
17+
});
18+
19+
it(`should have as title 'schedule-ang8'`, () => {
20+
const fixture = TestBed.createComponent(AppComponent);
21+
const app = fixture.debugElement.componentInstance;
22+
expect(app.title).toEqual('schedule-ang8');
23+
});
24+
25+
it('should render title', () => {
26+
const fixture = TestBed.createComponent(AppComponent);
27+
fixture.detectChanges();
28+
const compiled = fixture.debugElement.nativeElement;
29+
expect(compiled.querySelector('.content span').textContent).toContain('schedule-ang8 app is running!');
30+
});
31+
});

src/app/app.component.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Component, ChangeDetectionStrategy } from '@angular/core';
2+
import {
3+
DayService, WeekService, WorkWeekService, MonthService, ResizeService, DragAndDropService, EventSettingsModel
4+
} from '@syncfusion/ej2-angular-schedule';
5+
import { scheduleData } from './data';
6+
7+
@Component({
8+
selector: 'app-root',
9+
templateUrl: './app.component.html',
10+
styleUrls: ['./app.component.css'],
11+
providers: [DayService, WeekService, WorkWeekService, MonthService, ResizeService, DragAndDropService],
12+
changeDetection: ChangeDetectionStrategy.OnPush
13+
})
14+
export class AppComponent {
15+
title = 'schedule-ang8';
16+
public selectedDate: Date = new Date(2018, 1, 15);
17+
public eventSettings: EventSettingsModel = {
18+
dataSource: scheduleData
19+
};
20+
public getWorkDays() {
21+
const workDays = [1, 2, 3];
22+
return workDays;
23+
}
24+
}

src/app/app.module.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { NgModule } from '@angular/core';
3+
// import the ScheduleModule for the Schedule component
4+
import { ScheduleModule } from '@syncfusion/ej2-angular-schedule';
5+
import { AppComponent } from './app.component';
6+
7+
@NgModule({
8+
declarations: [
9+
AppComponent
10+
],
11+
imports: [
12+
BrowserModule, ScheduleModule
13+
],
14+
providers: [],
15+
bootstrap: [AppComponent]
16+
})
17+
export class AppModule { }

src/app/data.ts

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/**
2+
* Schedule datasource
3+
*/
4+
export let scheduleData: object[] = [
5+
{
6+
Id: 1,
7+
Subject: 'Explosion of Betelgeuse Star',
8+
StartTime: new Date(2018, 1, 11, 9, 30),
9+
EndTime: new Date(2018, 1, 11, 11, 0),
10+
CategoryColor: '#1aaa55'
11+
}, {
12+
Id: 2,
13+
Subject: 'Thule Air Crash Report',
14+
StartTime: new Date(2018, 1, 12, 12, 0),
15+
EndTime: new Date(2018, 1, 12, 14, 0),
16+
CategoryColor: '#357cd2'
17+
}, {
18+
Id: 3,
19+
Subject: 'Blue Moon Eclipse',
20+
StartTime: new Date(2018, 1, 13, 9, 30),
21+
EndTime: new Date(2018, 1, 13, 11, 0),
22+
CategoryColor: '#7fa900'
23+
}, {
24+
Id: 4,
25+
Subject: 'Meteor Showers in 2018',
26+
StartTime: new Date(2018, 1, 14, 13, 0),
27+
EndTime: new Date(2018, 1, 14, 14, 30),
28+
CategoryColor: '#ea7a57'
29+
}, {
30+
Id: 5,
31+
Subject: 'Milky Way as Melting pot',
32+
StartTime: new Date(2018, 1, 15, 12, 0),
33+
EndTime: new Date(2018, 1, 15, 14, 0),
34+
CategoryColor: '#00bdae'
35+
}, {
36+
Id: 6,
37+
Subject: 'Mysteries of Bermuda Triangle',
38+
StartTime: new Date(2018, 1, 15, 9, 30),
39+
EndTime: new Date(2018, 1, 15, 11, 0),
40+
CategoryColor: '#f57f17'
41+
}, {
42+
Id: 7,
43+
Subject: 'Glaciers and Snowflakes',
44+
StartTime: new Date(2018, 1, 16, 11, 0),
45+
EndTime: new Date(2018, 1, 16, 12, 30),
46+
CategoryColor: '#1aaa55'
47+
}, {
48+
Id: 8,
49+
Subject: 'Life on Mars',
50+
StartTime: new Date(2018, 1, 17, 9, 0),
51+
EndTime: new Date(2018, 1, 17, 10, 0),
52+
CategoryColor: '#357cd2'
53+
}, {
54+
Id: 9,
55+
Subject: 'Alien Civilization',
56+
StartTime: new Date(2018, 1, 19, 11, 0),
57+
EndTime: new Date(2018, 1, 19, 13, 0),
58+
CategoryColor: '#7fa900'
59+
}, {
60+
Id: 10,
61+
Subject: 'Wildlife Galleries',
62+
StartTime: new Date(2018, 1, 21, 11, 0),
63+
EndTime: new Date(2018, 1, 21, 13, 0),
64+
CategoryColor: '#ea7a57'
65+
}, {
66+
Id: 11,
67+
Subject: 'Best Photography 2018',
68+
StartTime: new Date(2018, 1, 22, 9, 30),
69+
EndTime: new Date(2018, 1, 22, 11, 0),
70+
CategoryColor: '#00bdae'
71+
}, {
72+
Id: 12,
73+
Subject: 'Smarter Puppies',
74+
StartTime: new Date(2018, 1, 9, 10, 0),
75+
EndTime: new Date(2018, 1, 9, 11, 30),
76+
CategoryColor: '#f57f17'
77+
}, {
78+
Id: 13,
79+
Subject: 'Myths of Andromeda Galaxy',
80+
StartTime: new Date(2018, 1, 7, 10, 30),
81+
EndTime: new Date(2018, 1, 7, 12, 30),
82+
CategoryColor: '#1aaa55'
83+
}, {
84+
Id: 14,
85+
Subject: 'Aliens vs Humans',
86+
StartTime: new Date(2018, 1, 5, 10, 0),
87+
EndTime: new Date(2018, 1, 5, 11, 30),
88+
CategoryColor: '#357cd2'
89+
}, {
90+
Id: 15,
91+
Subject: 'Facts of Humming Birds',
92+
StartTime: new Date(2018, 1, 20, 9, 30),
93+
EndTime: new Date(2018, 1, 20, 11, 0),
94+
CategoryColor: '#7fa900'
95+
}, {
96+
Id: 16,
97+
Subject: 'Sky Gazers',
98+
StartTime: new Date(2018, 1, 23, 11, 0),
99+
EndTime: new Date(2018, 1, 23, 13, 0),
100+
CategoryColor: '#ea7a57'
101+
}, {
102+
Id: 17,
103+
Subject: 'The Cycle of Seasons',
104+
StartTime: new Date(2018, 1, 12, 5, 30),
105+
EndTime: new Date(2018, 1, 12, 7, 30),
106+
CategoryColor: '#00bdae'
107+
}, {
108+
Id: 18,
109+
Subject: 'Space Galaxies and Planets',
110+
StartTime: new Date(2018, 1, 12, 17, 0),
111+
EndTime: new Date(2018, 1, 12, 18, 30),
112+
CategoryColor: '#f57f17'
113+
}, {
114+
Id: 19,
115+
Subject: 'Lifecycle of Bumblebee',
116+
StartTime: new Date(2018, 1, 15, 6, 0),
117+
EndTime: new Date(2018, 1, 15, 7, 30),
118+
CategoryColor: '#7fa900'
119+
}, {
120+
Id: 20,
121+
Subject: 'Sky Gazers',
122+
StartTime: new Date(2018, 1, 15, 16, 0),
123+
EndTime: new Date(2018, 1, 15, 18, 0),
124+
CategoryColor: '#ea7a57'
125+
}
126+
];

0 commit comments

Comments
 (0)