diff --git a/collections/forms/i18n/en.pot b/collections/forms/i18n/en.pot index e65ed246e0..581c2d0a90 100644 --- a/collections/forms/i18n/en.pot +++ b/collections/forms/i18n/en.pot @@ -5,8 +5,8 @@ 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: 2024-02-12T14:58:56.792Z\n" -"PO-Revision-Date: 2024-02-12T14:58:56.792Z\n" +"POT-Creation-Date: 2024-02-15T10:07:40.463Z\n" +"PO-Revision-Date: 2024-02-15T10:07:40.463Z\n" msgid "Upload file" msgstr "Upload file" diff --git a/components/button/src/button/__tests__/Button.test.js b/components/button/src/button/__tests__/Button.test.js index 9126fb798f..edd9b01d20 100644 --- a/components/button/src/button/__tests__/Button.test.js +++ b/components/button/src/button/__tests__/Button.test.js @@ -4,6 +4,52 @@ import React from 'react' import { Button } from '../button.js' describe(') + + expect(consoleSpy).not.toHaveBeenCalled() + }) + + it('does not warn if aria-label or title is present', () => { + render( + + ) + + expect(consoleSpy).not.toHaveBeenCalled() + }) + + it('warns if no children are present with no arial-label and title', () => { + render() + + expect(consoleSpy).toHaveBeenCalledWith( + 'Button component has no children but is missing title or ariaLabel attribute.' + ) + }) + + it('No warning if there are no children but arial label and title', () => { + render( + + ) + + expect(consoleSpy).not.toHaveBeenCalled() + }) + }) + it('renders a default data-test attribute', () => { const dataTest = 'dhis2-uicore-button' const wrapper = mount(