Skip to content

Commit

Permalink
test(esl-utils): apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
NastaLeo committed Feb 26, 2024
1 parent 372d5c2 commit 6c3f9c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/modules/esl-utils/decorators/test/attr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('Decorator: attr', () => {
expect(el.defProvider).toBe('');
});

describe('inherit parameter', () => {
describe('Inherit parameter', () => {

class ThirdElement extends HTMLElement {
@attr({inherit: 'box'})
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('Decorator: attr', () => {
TEMPLATE.$thirdEl.container = 'container';
expect(TEMPLATE.$thirdEl.container).toBe('container');
});
test('The value resolves from the closest element (custom-element) in DOM', () => {
test('The value should be resolved from the closest DOM element (custom-element)', () => {
TEMPLATE.$secondEl.setAttribute('box', 'carousel');
expect(TEMPLATE.$thirdEl.container).toBe('carousel');
});
Expand Down
6 changes: 3 additions & 3 deletions src/modules/esl-utils/dom/test/attr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ describe('Attribute', () => {
$parent.append($el);
document.body.append($parent);

test('finds indicated attribute on this element', () => {
test('should return attribute from the current element', () => {
expect(getClosestAttr($el, attrName)).toBe(attrValue);
});
test('finds indicated attribute on closest parent in DOM', () => {
test('should return an attribute from the parent DOM element', () => {
expect(getClosestAttr($el, $parentName)).toBe($parentValue);
});
test('returns null in case indicated attribute is absent in DOM', () => {
test('should return null in case the specified attribute is absent at the current element and its parents', () => {
expect(getClosestAttr($el, 'name')).toBe(null);
});
});
Expand Down

0 comments on commit 6c3f9c2

Please sign in to comment.