2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-17 19:21:20 +03:00

feat(plugin-helper): move getUniqAttr from preset to plugin helper (#63)

This commit is contained in:
Nikolay Kostyurin
2020-04-12 16:18:47 +02:00
committed by GitHub
parent 2cfe729d75
commit f28f19e64c
3 changed files with 24 additions and 7 deletions
+11 -2
View File
@@ -3,6 +3,7 @@ import {
attrValue,
appendToNode,
getNodeLength,
getUniqAttr,
isTagNode,
isStringNode,
isEOL,
@@ -78,9 +79,17 @@ describe('@bbob/plugin-helper', () => {
foo: 'bar',
disabled: true
})).toBe(` tag="test" foo="bar" disabled`)
})
});
test('attrsToString undefined', () => {
expect(attrsToString(undefined)).toBe('')
})
});
test('getUniqAttr with unq attr', () => {
expect(getUniqAttr({foo: true, 'http://bar.com': 'http://bar.com'})).toBe('http://bar.com')
});
test('getUniqAttr without unq attr', () => {
expect(getUniqAttr({foo: true})).toBe(null)
})
});