Skip to content

Commit

Permalink
fix(widgets): add translated default texts
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed May 20, 2020
1 parent 662d884 commit c85342d
Show file tree
Hide file tree
Showing 45 changed files with 504 additions and 79 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: Button label for the FileInputField

Scenario: Rendering a FileInputField
Given a default FileInputField is rendered
Then the default button label is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'

Given('a default FileInputField is rendered', () => {
cy.visitStory('FileInputField', 'Default')
})

Then('the default button label is visible', () => {
cy.contains('Upload a file').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: Placeholder for the FileInputField

Scenario: Rendering a FileInputField
Given a default FileInputField is rendered
Then the default placeholder is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'

Given('a default FileInputField is rendered', () => {
cy.visitStory('FileInputField', 'Default')
})

Then('the default placeholder is visible', () => {
cy.contains('No file uploaded yet').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: Button label for the FileInputFieldWithList

Scenario: Rendering a FileInputFieldWithList
Given a default FileInputFieldWithList is rendered
Then the default button label is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'

Given('a default FileInputFieldWithList is rendered', () => {
cy.visitStory('FileInputFieldWithList', 'With default texts')
})

Then('the default button label is visible', () => {
cy.contains('Upload a file').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: Placeholder for the FileInputFieldWithList

Scenario: Rendering a FileInputFieldWithList
Given a default FileInputFieldWithList is rendered
Then the default placeholder is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'

Given('a default FileInputFieldWithList is rendered', () => {
cy.visitStory('FileInputFieldWithList', 'With default texts')
})

Then('the default placeholder is visible', () => {
cy.contains('No file uploaded yet').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: Placeholder for the FileInputFieldWithList

Scenario: Rendering a FileInputFieldWithList
Given a default FileInputFieldWithList is rendered
Then the default remove text is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'

Given('a default FileInputFieldWithList is rendered', () => {
cy.visitStory('FileInputFieldWithList', 'With file and default texts')
})

Then('the default remove text is visible', () => {
cy.contains('Remove').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: Clear text for the MultiSelectField

Scenario: Rendering a clearable MultiSelectField
Given a clearable MultiSelectField with selected option is rendered
Then the clear text is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'

Given('a clearable MultiSelectField with selected option is rendered', () => {
cy.visitStory('MultiSelectField', 'With clearable and selected option')
})

Then('the clear text is visible', () => {
cy.contains('Clear').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Feature: Empty text for the MultiSelectField

Scenario: Rendering an empty MultiSelectField
Given an empty MultiSelectField is rendered
When the Select is opened
Then the empty text is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps'

Given('an empty MultiSelectField is rendered', () => {
cy.visitStory('MultiSelectField', 'Without options')
})

When('the Select is opened', () => {
cy.get('[data-test="dhis2-uicore-select-input"]').click()
})

Then('the empty text is visible', () => {
cy.contains('No data found').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature: Nomatchtext for the MultiSelectField

Scenario: Rendering a filterable MultiSelectField
Given a filterable MultiSelectField is rendered
When the Select is opened
And a filter that does not match any options is entered
Then the no match text is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps'

Given('a filterable MultiSelectField is rendered', () => {
cy.visitStory('MultiSelectField', 'With filterable')
})

When('the Select is opened', () => {
cy.get('[data-test="dhis2-uicore-select-input"]').click()
})

When('a filter that does not match any options is entered', () => {
cy.focused().type('Two')
})

Then('the no match text is visible', () => {
cy.contains('No options found').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Feature: Filter placeholder for the MultiSelectField

Scenario: Rendering a filterable MultiSelectField
Given a filterable MultiSelectField is rendered
When the Select is opened
Then the filter placeholder exists
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps'

Given('a filterable MultiSelectField is rendered', () => {
cy.visitStory('MultiSelectField', 'With filterable')
})

When('the Select is opened', () => {
cy.get('[data-test="dhis2-uicore-select-input"]').click()
})

Then('the filter placeholder exists', () => {
cy.get(
'[data-test="dhis2-uicore-multiselect-filterinput"] [placeholder="Type to filter options"]'
).should('exist')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Feature: Filter placeholder for the MultiSelectField

Scenario: Rendering a filterable MultiSelectField
Given a loading MultiSelectField is rendered
When the Select is opened
Then the loading text is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps'

Given('a loading MultiSelectField is rendered', () => {
cy.visitStory('MultiSelectField', 'With loading')
})

When('the Select is opened', () => {
cy.get('[data-test="dhis2-uicore-select-input"]').click()
})

Then('the loading text is visible', () => {
cy.contains('Loading options').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: Clear text for the SingleSelectField

Scenario: Rendering a clearable SingleSelectField
Given a clearable SingleSelectField with selected option is rendered
Then the clear text is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'

Given('a clearable SingleSelectField with selected option is rendered', () => {
cy.visitStory('SingleSelectField', 'With clearable and selected option')
})

Then('the clear text is visible', () => {
cy.contains('Clear').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Feature: Empty text for the SingleSelectField

Scenario: Rendering an empty SingleSelectField
Given an empty SingleSelectField is rendered
When the Select is opened
Then the empty text is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps'

Given('an empty SingleSelectField is rendered', () => {
cy.visitStory('SingleSelectField', 'Without options')
})

When('the Select is opened', () => {
cy.get('[data-test="dhis2-uicore-select-input"]').click()
})

Then('the empty text is visible', () => {
cy.contains('No data found').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature: Nomatchtext for the SingleSelectField

Scenario: Rendering a filterable SingleSelectField
Given a filterable SingleSelectField is rendered
When the Select is opened
And a filter that does not match any options is entered
Then the no match text is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps'

Given('a filterable SingleSelectField is rendered', () => {
cy.visitStory('SingleSelectField', 'With filterable')
})

When('the Select is opened', () => {
cy.get('[data-test="dhis2-uicore-select-input"]').click()
})

When('a filter that does not match any options is entered', () => {
cy.focused().type('Two')
})

Then('the no match text is visible', () => {
cy.contains('No options found').should('be.visible')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Feature: Filter placeholder for the SingleSelectField

Scenario: Rendering a filterable SingleSelectField
Given a filterable SingleSelectField is rendered
When the Select is opened
Then the filter placeholder exists
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps'

Given('a filterable SingleSelectField is rendered', () => {
cy.visitStory('SingleSelectField', 'With filterable')
})

When('the Select is opened', () => {
cy.get('[data-test="dhis2-uicore-select-input"]').click()
})

Then('the filter placeholder exists', () => {
cy.get(
'[data-test="dhis2-uicore-singleselect-filterinput"] [placeholder="Type to filter options"]'
).should('exist')
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Feature: Filter placeholder for the SingleSelectField

Scenario: Rendering a filterable SingleSelectField
Given a loading SingleSelectField is rendered
When the Select is opened
Then the loading text is visible
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps'

Given('a loading SingleSelectField is rendered', () => {
cy.visitStory('SingleSelectField', 'With loading')
})

When('the Select is opened', () => {
cy.get('[data-test="dhis2-uicore-select-input"]').click()
})

Then('the loading text is visible', () => {
cy.contains('Loading options').should('be.visible')
})
30 changes: 27 additions & 3 deletions packages/widgets/i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2020-02-18T13:19:29.126Z\n"
"PO-Revision-Date: 2020-02-18T13:19:29.126Z\n"
"POT-Creation-Date: 2020-05-14T13:50:41.269Z\n"
"PO-Revision-Date: 2020-05-14T13:50:41.269Z\n"

msgid "Upload a file"
msgstr ""

msgid "No file uploaded yet"
msgstr ""

msgid "Remove"
msgstr ""

msgid "Search apps"
msgstr ""
Expand All @@ -29,5 +38,20 @@ msgstr ""
msgid "Logout"
msgstr ""

msgid "Something went wrong with loading the children."
msgid "Clear"
msgstr ""

msgid "No data found"
msgstr ""

msgid "Type to filter options"
msgstr ""

msgid "Loading options"
msgstr ""

msgid "No options found"
msgstr ""

msgid "Could not load children"
msgstr ""
Loading

0 comments on commit c85342d

Please sign in to comment.