diff --git a/cliff.toml b/cliff.toml index a06ea1dad..9e2ff468c 100644 --- a/cliff.toml +++ b/cliff.toml @@ -18,7 +18,7 @@ body = """ {% if previous.version %}\ ## [{{ version | trim_start_matches(pat="v") }}](/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} {% else %}\ - ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(timezone="America/New_York", format="%Y-%m-%d") }} {% endif %}\ {% else %}\ ## [unreleased] diff --git a/packages/cfpb-design-system/src/utilities/atomic-helpers.spec.js b/packages/cfpb-design-system/src/utilities/atomic-helpers.spec.js index d813cf38f..bc085ffdb 100644 --- a/packages/cfpb-design-system/src/utilities/atomic-helpers.spec.js +++ b/packages/cfpb-design-system/src/utilities/atomic-helpers.spec.js @@ -57,7 +57,7 @@ describe('atomic-helpers', () => { 'Check that element is a DOM node with ' + `class ".${testClass}"`; /** - * + * Mock error function. */ function errFunc() { checkDom(null, testClass); @@ -68,7 +68,7 @@ describe('atomic-helpers', () => { it('should throw an error if element class not found', () => { const errMsg = 'mock-class not found on or in passed DOM node.'; /** - * + * Mock error function. */ function errFunc() { checkDom(componentDom, 'mock-class'); diff --git a/packages/cfpb-design-system/src/utilities/behavior/behavior.spec.js b/packages/cfpb-design-system/src/utilities/behavior/behavior.spec.js new file mode 100644 index 000000000..592bf9a35 --- /dev/null +++ b/packages/cfpb-design-system/src/utilities/behavior/behavior.spec.js @@ -0,0 +1,36 @@ +import { checkBehaviorDom, behaviorFind } from './behavior.js'; + +let containerDom; + +const HTML_SNIPPET = ` +
+
+`; + +describe('behaviors', () => { + beforeEach(() => { + document.body.innerHTML = HTML_SNIPPET; + containerDom = document.querySelector('#container'); + }); + + describe('.checkBehaviorDom()', () => { + it('should return an HTML element', () => { + expect( + checkBehaviorDom( + containerDom, + 'behavior_flyout-menu_content', + ).getAttribute('data-js-hook'), + ).toBe('behavior_flyout-menu_content'); + }); + }); + + describe('.behaviorFind()', () => { + it('should return an array with two items when selectors are found', () => { + const result = behaviorFind('flyout-menu', containerDom); + expect(result).toBeInstanceOf(NodeList); + expect(result.length).toBe(2); + }); + }); +});