Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
UpperCod committed Jan 24, 2023
1 parent c0a57be commit dcffdcb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/element/custom-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const c = (component, base) => {

const { props, styles, name } = component;

const className = name[0].toUpperCase() + name.slice(1);
const className = (name[0] || "").toUpperCase() + name.slice(1);
/**
* @todo Discover a more aesthetic solution at the type level
* TS tries to set local class rules, these should be ignored
Expand Down
10 changes: 10 additions & 0 deletions src/tests/element.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ export function customElementScope(component, autoScope = true) {
}

describe("src/element", () => {
it("name", () => {
function myElement() {}

myElement.props = {
value: Number,
};

expect(c(myElement).name).to.equal("MyElement");
});

it("watch update", (done) => {
function a() {}

Expand Down

0 comments on commit dcffdcb

Please sign in to comment.