@dhis2-ui/calendar 9.5.0-alpha.1 → 9.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/build/cjs/features/supports_calendar_clear_button/supports_calendar_clear_button.js +6 -6
- package/build/cjs/features/supports_ethiopic_calendar/supports_ethiopic_calendar.js +6 -6
- package/build/cjs/features/supports_gregorian_calendar/supports_gregorian_calendar.js +5 -5
- package/build/cjs/features/supports_islamic_calendar/supports_islamic_calendar.js +3 -3
- package/build/cjs/features/supports_nepali_calendar/supports_nepali_calendar.js +5 -5
- package/build/es/features/supports_calendar_clear_button/supports_calendar_clear_button.js +4 -4
- package/build/es/features/supports_ethiopic_calendar/supports_ethiopic_calendar.js +3 -3
- package/build/es/features/supports_gregorian_calendar/supports_gregorian_calendar.js +2 -2
- package/build/es/features/supports_islamic_calendar/supports_islamic_calendar.js +1 -1
- package/build/es/features/supports_nepali_calendar/supports_nepali_calendar.js +2 -2
- package/package.json +10 -10
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
4
4
|
|
5
|
-
(0,
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a "{word}" calendar is rendered with a selected date "{word}"', (calendar, initialDate) => {
|
6
6
|
cy.visitStory('CalendarInputTesting', 'Test Calendar With Clear Button', {
|
7
7
|
qs: {
|
8
8
|
initialDate,
|
@@ -11,22 +11,22 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
11
11
|
});
|
12
12
|
cy.get('[data-test="storybook-calendar-date-value"]').should('have.text', initialDate);
|
13
13
|
});
|
14
|
-
(0,
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('we should be able to clear it', () => {
|
15
15
|
cy.get("[data-test=\"calendar-clear-button\"]").click();
|
16
16
|
cy.get('[data-test="storybook-calendar-date-value"]').should('have.text', 'undefined');
|
17
17
|
});
|
18
|
-
(0,
|
18
|
+
(0, _cypressCucumberPreprocessor.Then)('show the current month afterwards', () => {
|
19
19
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]').click();
|
20
20
|
cy.get('.isToday').should('be.visible');
|
21
21
|
});
|
22
|
-
(0,
|
22
|
+
(0, _cypressCucumberPreprocessor.Then)("allow selecting today's date", () => {
|
23
23
|
cy.get('.isToday').parent().invoke('attr', 'data-test').then(todayDate => {
|
24
24
|
cy.get('.isToday').click();
|
25
25
|
cy.get('[data-test="storybook-calendar-date-value"]').should('have.text', todayDate);
|
26
26
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"] input').should('have.value', todayDate);
|
27
27
|
});
|
28
28
|
});
|
29
|
-
(0,
|
29
|
+
(0, _cypressCucumberPreprocessor.Then)('highlight today as the selected date', () => {
|
30
30
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]').click();
|
31
31
|
cy.get('.isToday').parent().invoke('attr', 'data-test').then(todayDate => {
|
32
32
|
cy.get('.isSelected').should('have.text', Number(todayDate.split('-')[2]).toString());
|
@@ -1,19 +1,19 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
4
4
|
|
5
|
-
(0,
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('an Ethiopic calendar is rendered in {word}', language => {
|
6
6
|
cy.visitStory('CalendarInputTesting', "Ethiopic With ".concat(language));
|
7
7
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]').click();
|
8
8
|
cy.get('[data-test=calendar]').should('be.visible');
|
9
9
|
});
|
10
|
-
(0,
|
10
|
+
(0, _cypressCucumberPreprocessor.Then)('days should be rendered in "{word}"', language => {
|
11
11
|
const days = language === 'amharic' ? ['ሰኞ', 'ማክሰ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ', 'እሑድ'] : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
12
12
|
days.forEach(day => {
|
13
13
|
cy.contains(day).should('be.visible');
|
14
14
|
});
|
15
15
|
});
|
16
|
-
(0,
|
16
|
+
(0, _cypressCucumberPreprocessor.Then)('months should be rendered in "{word}" with navigation', language => {
|
17
17
|
const months = language === 'amharic' ? {
|
18
18
|
current: 'ጥቅምት',
|
19
19
|
previous: 'መስከረም',
|
@@ -30,10 +30,10 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
30
30
|
cy.get('[data-test="calendar-previous-month"]').click();
|
31
31
|
cy.contains(months.previous).should('be.visible');
|
32
32
|
});
|
33
|
-
(0,
|
33
|
+
(0, _cypressCucumberPreprocessor.Then)('the era should not be displayed in the year', () => {
|
34
34
|
cy.get('[data-test="calendar-current-year"]').should('not.contain.text', 'ERA1');
|
35
35
|
});
|
36
|
-
(0,
|
36
|
+
(0, _cypressCucumberPreprocessor.Then)('we should be able to select a day', () => {
|
37
37
|
const date = '2014-02-03';
|
38
38
|
cy.get("[data-test=\"".concat(date, "\"]")).click();
|
39
39
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"] input').should('have.value', date);
|
@@ -1,19 +1,19 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
4
4
|
|
5
|
-
(0,
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a Gregorian calendar is rendered in {word}', language => {
|
6
6
|
cy.visitStory('CalendarInputTesting', "Gregorian With ".concat(language));
|
7
7
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]').click();
|
8
8
|
cy.get('[data-test=calendar]').should('be.visible');
|
9
9
|
});
|
10
|
-
(0,
|
10
|
+
(0, _cypressCucumberPreprocessor.Then)('days should be rendered in "{word}"', language => {
|
11
11
|
const days = language === 'arabic' ? ['الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت', 'الأحد'] : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
12
12
|
days.forEach(day => {
|
13
13
|
cy.contains(day).should('be.visible');
|
14
14
|
});
|
15
15
|
});
|
16
|
-
(0,
|
16
|
+
(0, _cypressCucumberPreprocessor.Then)('months should be rendered in "{word}" with navigation', language => {
|
17
17
|
const months = language === 'english' ? {
|
18
18
|
current: 'October',
|
19
19
|
previous: 'September',
|
@@ -30,7 +30,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
30
30
|
cy.get('[data-test="calendar-previous-month"]').click();
|
31
31
|
cy.contains(months.previous).should('be.visible');
|
32
32
|
});
|
33
|
-
(0,
|
33
|
+
(0, _cypressCucumberPreprocessor.Then)('we should be able to select a day', () => {
|
34
34
|
const date = '2021-10-13';
|
35
35
|
cy.get("[data-test=\"".concat(date, "\"]")).click();
|
36
36
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"] input').should('have.value', date);
|
@@ -1,13 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
4
4
|
|
5
|
-
(0,
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('an Islamic calendar is rendered with Arabic locale', () => {
|
6
6
|
cy.visitStory('CalendarInputTesting', "Islamic With Arabic");
|
7
7
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]').click();
|
8
8
|
cy.get('[data-test=calendar]').should('be.visible');
|
9
9
|
});
|
10
|
-
(0,
|
10
|
+
(0, _cypressCucumberPreprocessor.Then)('days should be rendered in Arabic', () => {
|
11
11
|
cy.contains('الأحد').should('be.visible');
|
12
12
|
cy.contains('السبت').should('be.visible');
|
13
13
|
cy.contains('الجمعة').should('be.visible');
|
@@ -1,21 +1,21 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
4
4
|
|
5
|
-
(0,
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a nepali calendar in "{word}" is rendered', language => {
|
6
6
|
cy.visitStory('CalendarInputTesting', "Nepali With ".concat(language));
|
7
7
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]', {
|
8
8
|
timeout: 10000
|
9
9
|
}).click();
|
10
10
|
cy.get('[data-test=calendar]').should('be.visible');
|
11
11
|
});
|
12
|
-
(0,
|
12
|
+
(0, _cypressCucumberPreprocessor.Then)('nepali days should be rendered in "{word}"', language => {
|
13
13
|
const days = language === 'nepali' ? ['आइत', 'सोम', 'सोम', 'बुध', 'बिही', 'शुक्र', 'शनि'] : ['Som', 'Mangl', 'Budha', 'Bihi', 'Shukra', 'Shani', 'Aaita'];
|
14
14
|
days.forEach(day => {
|
15
15
|
cy.contains(day).should('be.visible');
|
16
16
|
});
|
17
17
|
});
|
18
|
-
(0,
|
18
|
+
(0, _cypressCucumberPreprocessor.Then)('months should be rendered in "{word}" with navigation', language => {
|
19
19
|
//
|
20
20
|
const months = language === 'nepali' ? {
|
21
21
|
current: 'असोज',
|
@@ -33,7 +33,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
33
33
|
cy.get('[data-test="calendar-previous-month"]').click();
|
34
34
|
cy.contains(months.previous).should('be.visible');
|
35
35
|
});
|
36
|
-
(0,
|
36
|
+
(0, _cypressCucumberPreprocessor.Then)('we should be able to select a day', () => {
|
37
37
|
const nepaliDate = '2078-06-27';
|
38
38
|
cy.get("[data-test=\"".concat(nepaliDate, "\"]")).click();
|
39
39
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"] input').should('have.value', nepaliDate);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Given, Then
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
2
2
|
Given('a "{word}" calendar is rendered with a selected date "{word}"', (calendar, initialDate) => {
|
3
3
|
cy.visitStory('CalendarInputTesting', 'Test Calendar With Clear Button', {
|
4
4
|
qs: {
|
@@ -12,18 +12,18 @@ Then('we should be able to clear it', () => {
|
|
12
12
|
cy.get("[data-test=\"calendar-clear-button\"]").click();
|
13
13
|
cy.get('[data-test="storybook-calendar-date-value"]').should('have.text', 'undefined');
|
14
14
|
});
|
15
|
-
|
15
|
+
Then('show the current month afterwards', () => {
|
16
16
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]').click();
|
17
17
|
cy.get('.isToday').should('be.visible');
|
18
18
|
});
|
19
|
-
|
19
|
+
Then("allow selecting today's date", () => {
|
20
20
|
cy.get('.isToday').parent().invoke('attr', 'data-test').then(todayDate => {
|
21
21
|
cy.get('.isToday').click();
|
22
22
|
cy.get('[data-test="storybook-calendar-date-value"]').should('have.text', todayDate);
|
23
23
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"] input').should('have.value', todayDate);
|
24
24
|
});
|
25
25
|
});
|
26
|
-
|
26
|
+
Then('highlight today as the selected date', () => {
|
27
27
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]').click();
|
28
28
|
cy.get('.isToday').parent().invoke('attr', 'data-test').then(todayDate => {
|
29
29
|
cy.get('.isSelected').should('have.text', Number(todayDate.split('-')[2]).toString());
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Given, Then
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
2
2
|
Given('an Ethiopic calendar is rendered in {word}', language => {
|
3
3
|
cy.visitStory('CalendarInputTesting', "Ethiopic With ".concat(language));
|
4
4
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]').click();
|
@@ -10,7 +10,7 @@ Then('days should be rendered in "{word}"', language => {
|
|
10
10
|
cy.contains(day).should('be.visible');
|
11
11
|
});
|
12
12
|
});
|
13
|
-
|
13
|
+
Then('months should be rendered in "{word}" with navigation', language => {
|
14
14
|
const months = language === 'amharic' ? {
|
15
15
|
current: 'ጥቅምት',
|
16
16
|
previous: 'መስከረም',
|
@@ -27,7 +27,7 @@ And('months should be rendered in "{word}" with navigation', language => {
|
|
27
27
|
cy.get('[data-test="calendar-previous-month"]').click();
|
28
28
|
cy.contains(months.previous).should('be.visible');
|
29
29
|
});
|
30
|
-
|
30
|
+
Then('the era should not be displayed in the year', () => {
|
31
31
|
cy.get('[data-test="calendar-current-year"]').should('not.contain.text', 'ERA1');
|
32
32
|
});
|
33
33
|
Then('we should be able to select a day', () => {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Given, Then
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
2
2
|
Given('a Gregorian calendar is rendered in {word}', language => {
|
3
3
|
cy.visitStory('CalendarInputTesting', "Gregorian With ".concat(language));
|
4
4
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]').click();
|
@@ -10,7 +10,7 @@ Then('days should be rendered in "{word}"', language => {
|
|
10
10
|
cy.contains(day).should('be.visible');
|
11
11
|
});
|
12
12
|
});
|
13
|
-
|
13
|
+
Then('months should be rendered in "{word}" with navigation', language => {
|
14
14
|
const months = language === 'english' ? {
|
15
15
|
current: 'October',
|
16
16
|
previous: 'September',
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
2
2
|
Given('an Islamic calendar is rendered with Arabic locale', () => {
|
3
3
|
cy.visitStory('CalendarInputTesting', "Islamic With Arabic");
|
4
4
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]').click();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Given, Then
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
2
2
|
Given('a nepali calendar in "{word}" is rendered', language => {
|
3
3
|
cy.visitStory('CalendarInputTesting', "Nepali With ".concat(language));
|
4
4
|
cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"]', {
|
@@ -12,7 +12,7 @@ Then('nepali days should be rendered in "{word}"', language => {
|
|
12
12
|
cy.contains(day).should('be.visible');
|
13
13
|
});
|
14
14
|
});
|
15
|
-
|
15
|
+
Then('months should be rendered in "{word}" with navigation', language => {
|
16
16
|
//
|
17
17
|
const months = language === 'nepali' ? {
|
18
18
|
current: 'असोज',
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dhis2-ui/calendar",
|
3
|
-
"version": "9.5.0
|
3
|
+
"version": "9.5.0",
|
4
4
|
"description": "UI Calendar",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -27,21 +27,21 @@
|
|
27
27
|
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
|
28
28
|
},
|
29
29
|
"peerDependencies": {
|
30
|
-
"react": "^16.8",
|
31
30
|
"@dhis2/d2-i18n": "^1",
|
31
|
+
"react": "^16.8",
|
32
32
|
"react-dom": "^16.8",
|
33
33
|
"styled-jsx": "^4"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
|
-
"@dhis2-ui/button": "9.5.0
|
37
|
-
"@dhis2-ui/card": "9.5.0
|
38
|
-
"@dhis2-ui/input": "9.5.0
|
39
|
-
"@dhis2-ui/layer": "9.5.0
|
40
|
-
"@dhis2-ui/popper": "9.5.0
|
41
|
-
"@dhis2/multi-calendar-dates": "1.
|
36
|
+
"@dhis2-ui/button": "9.5.0",
|
37
|
+
"@dhis2-ui/card": "9.5.0",
|
38
|
+
"@dhis2-ui/input": "9.5.0",
|
39
|
+
"@dhis2-ui/layer": "9.5.0",
|
40
|
+
"@dhis2-ui/popper": "9.5.0",
|
41
|
+
"@dhis2/multi-calendar-dates": "^1.1.1",
|
42
42
|
"@dhis2/prop-types": "^3.1.2",
|
43
|
-
"@dhis2/ui-constants": "9.5.0
|
44
|
-
"@dhis2/ui-icons": "9.5.0
|
43
|
+
"@dhis2/ui-constants": "9.5.0",
|
44
|
+
"@dhis2/ui-icons": "9.5.0",
|
45
45
|
"classnames": "^2.3.1",
|
46
46
|
"prop-types": "^15.7.2"
|
47
47
|
},
|