calendar.html revision 176bb1f5c1bead550f24ffc878201352795c73ad
b9a92ac181ee48352d731d7c0230eec4939e9e8cMatt Sweeney<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
b9a92ac181ee48352d731d7c0230eec4939e9e8cMatt Sweeney<script type="text/javascript" src="/build/yui/yui.js"></script>
base: "/build/",
filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'min'
var ASSERT = Y.Assert,
ARRAYASSERT = Y.ArrayAssert,
btnRun = Y.one("#btnRun"),
myConsole = new Y.Console().render();
btnRun.set("disabled", false);
Y.on("click", function(){
var BasicCalendar = new Y.Test.Case({
this.firstcalendar = null;
this.secondcalendar = null;
delete this.firstcalendar;
delete this.secondcalendar;
Y.one('#firstcontainer').remove();
Y.one('#secondcontainer').remove();
var calendarDate = this.firstcalendar.get("date");
Y.Assert.areEqual("27", Y.one("#firstcontainer").one(".calendar_col2.yui3-calendar-prevmonth-day").getContent());
Y.Assert.areEqual("28", Y.one("#firstcontainer").one(".calendar_col3.yui3-calendar-prevmonth-day").getContent());
Y.Assert.areEqual("29", Y.one("#firstcontainer").one(".calendar_col4.yui3-calendar-prevmonth-day").getContent());
Y.Assert.areEqual("30", Y.one("#firstcontainer").one(".calendar_col5.yui3-calendar-prevmonth-day").getContent());
Y.Assert.areEqual("1", Y.one("#firstcontainer").one(".calendar_col2.yui3-calendar-nextmonth-day").getContent());
Y.Assert.areEqual("2", Y.one("#firstcontainer").one(".calendar_col3.yui3-calendar-nextmonth-day").getContent());
Y.Assert.areEqual("3", Y.one("#firstcontainer").one(".calendar_col4.yui3-calendar-nextmonth-day").getContent());
Y.Assert.areEqual("4", Y.one("#firstcontainer").one(".calendar_col5.yui3-calendar-nextmonth-day").getContent());
Y.Assert.areEqual("5", Y.one("#firstcontainer").one(".calendar_col6.yui3-calendar-nextmonth-day").getContent());
Y.Assert.areEqual("6", Y.one("#firstcontainer").one(".calendar_col7.yui3-calendar-nextmonth-day").getContent());
Y.Assert.areEqual("7", Y.one("#firstcontainer").one(".calendar_col8.yui3-calendar-nextmonth-day").getContent());
var calendarid = this.firstcalendar._calendarId;
Y.one("#" + calendarid + "_pane_0_6_15").simulate("click");
var currentDate = this.firstcalendar.get("selectedDates")[0];
Y.one("#" + calendarid + "_pane_0_8_31").simulate("click");
currentDate = this.firstcalendar.get("selectedDates")[0];
Y.one(".yui3-calendarnav-nextmonth").simulate("click");
Y.one("#" + calendarid + "_pane_0_8_17").simulate("click");
currentDate = this.firstcalendar.get("selectedDates")[0];
var calendarid = this.firstcalendar._calendarId;
Y.one("#" + calendarid + "_pane_0_6_29").simulate("click");
Y.one("#" + calendarid + "_pane_1_7_2").simulate("click", {shiftKey: true});
var date0 = this.firstcalendar.get("selectedDates")[0];
var date1 = this.firstcalendar.get("selectedDates")[1];
var date2 = this.firstcalendar.get("selectedDates")[2];
var date3 = this.firstcalendar.get("selectedDates")[3];
var date4 = this.firstcalendar.get("selectedDates")[4];
var suite = new Y.Test.Suite({name:"Basic Calendar Test Suite"});
suite.add(BasicCalendar);
Y.Test.Runner.setName("Calendar Test Runner");
Y.Test.Runner.add(suite);