@dhis2-ui/calendar 9.4.4 → 9.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a "{word}" calendar is rendered with a selected date "{word}"', (calendar, initialDate) => {
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, _steps.Then)('we should be able to clear it', () => {
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, _steps.And)('show the current month afterwards', () => {
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, _steps.And)("allow selecting today's date", () => {
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, _steps.And)('highlight today as the selected date', () => {
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 _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('an Ethiopic calendar is rendered in {word}', language => {
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, _steps.Then)('days should be rendered in "{word}"', language => {
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, _steps.And)('months should be rendered in "{word}" with navigation', language => {
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, _steps.And)('the era should not be displayed in the year', () => {
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, _steps.Then)('we should be able to select a day', () => {
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 _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a Gregorian calendar is rendered in {word}', language => {
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, _steps.Then)('days should be rendered in "{word}"', language => {
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, _steps.And)('months should be rendered in "{word}" with navigation', language => {
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, _steps.Then)('we should be able to select a day', () => {
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 _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('an Islamic calendar is rendered with Arabic locale', () => {
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, _steps.Then)('days should be rendered in Arabic', () => {
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 _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a nepali calendar in "{word}" is rendered', language => {
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, _steps.Then)('nepali days should be rendered in "{word}"', language => {
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, _steps.And)('months should be rendered in "{word}" with navigation', language => {
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, _steps.Then)('we should be able to select a day', () => {
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, And } from 'cypress-cucumber-preprocessor/steps';
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
- And('show the current month afterwards', () => {
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
- And("allow selecting today's date", () => {
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
- And('highlight today as the selected date', () => {
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, And } from 'cypress-cucumber-preprocessor/steps';
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
- And('months should be rendered in "{word}" with navigation', language => {
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
- And('the era should not be displayed in the year', () => {
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, And } from 'cypress-cucumber-preprocessor/steps';
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
- And('months should be rendered in "{word}" with navigation', language => {
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/steps';
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, And } from 'cypress-cucumber-preprocessor/steps';
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
- And('months should be rendered in "{word}" with navigation', language => {
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.4.4",
3
+ "version": "9.4.5",
4
4
  "description": "UI Calendar",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,15 +33,15 @@
33
33
  "styled-jsx": "^4"
34
34
  },
35
35
  "dependencies": {
36
- "@dhis2-ui/button": "9.4.4",
37
- "@dhis2-ui/card": "9.4.4",
38
- "@dhis2-ui/input": "9.4.4",
39
- "@dhis2-ui/layer": "9.4.4",
40
- "@dhis2-ui/popper": "9.4.4",
36
+ "@dhis2-ui/button": "9.4.5",
37
+ "@dhis2-ui/card": "9.4.5",
38
+ "@dhis2-ui/input": "9.4.5",
39
+ "@dhis2-ui/layer": "9.4.5",
40
+ "@dhis2-ui/popper": "9.4.5",
41
41
  "@dhis2/multi-calendar-dates": "^1.1.1",
42
42
  "@dhis2/prop-types": "^3.1.2",
43
- "@dhis2/ui-constants": "9.4.4",
44
- "@dhis2/ui-icons": "9.4.4",
43
+ "@dhis2/ui-constants": "9.4.5",
44
+ "@dhis2/ui-icons": "9.4.5",
45
45
  "classnames": "^2.3.1",
46
46
  "prop-types": "^15.7.2"
47
47
  },