Skip to content

Commit b2d93af

Browse files
committed
chore: code coverage should at least be 100%
1 parent aec1eae commit b2d93af

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/editv2.spec.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const insert: Insert = { parent: element, node: element, reference: null };
2424
const remove: Remove = { node: element };
2525
const setAttributes: SetAttributes = {
2626
element,
27-
attributes: { name: 'value' },
28-
attributesNS: { namespaceURI: { name: 'value' } },
27+
attributes: { attrName: 'attrValue' },
28+
attributesNS: { myNamespaceURI: { attrName: 'attrValue' } },
2929
};
3030
const setTextContent: SetTextContent = { element, textContent: '' };
3131

@@ -42,6 +42,24 @@ describe('isEditV2', () => {
4242
it('returns true for SetAttributes', () =>
4343
expect(setAttributes).to.satisfy(isEditV2));
4444

45+
it('SetAttributes returns false where Attributes are invalid', () =>
46+
expect({
47+
element,
48+
attributes: 'invalid attr object',
49+
}).to.not.satisfy(isEditV2));
50+
51+
it('SetAttributes returns false where NSAttributes are missing', () =>
52+
expect({
53+
element,
54+
attributesNS: null,
55+
}).to.not.satisfy(isEditV2));
56+
57+
it('SetAttributes returns false if attr namespaced attr is not an object', () =>
58+
expect({
59+
element,
60+
attributesNS: { [1]: 'unacceptable' },
61+
}).to.not.satisfy(isEditV2));
62+
4563
it('returns true for SetTextContent', () =>
4664
expect(setTextContent).to.satisfy(isEditV2));
4765

0 commit comments

Comments
 (0)