@triptease/tt-navbar 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent tt-navbar following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "tt-navbar",
6
- "version": "0.0.10",
6
+ "version": "0.0.11",
7
7
  "type": "module",
8
8
  "main": "dist/src/index.js",
9
9
  "module": "dist/src/index.js",
package/src/TtNavbar.ts CHANGED
@@ -149,7 +149,11 @@ export class TtNavbar extends LitElement {
149
149
  </details>
150
150
  </div>
151
151
  <slot name="clientSelector"></slot>
152
- <slot name="logout"></slot>
152
+ <a
153
+ class="nav-item"
154
+ href=${this.buildUrl('/logout')}
155
+ @click=${this.onAnchorClick}
156
+ >Logout</a>
153
157
  </nav>
154
158
  `;
155
159
  }
@@ -29,7 +29,7 @@ describe('TtNavbar', () => {
29
29
  );
30
30
  const links = navbar.shadowRoot?.querySelectorAll('a');
31
31
 
32
- expect(links?.length).to.equal(13);
32
+ expect(links?.length).to.equal(14);
33
33
 
34
34
  if (links) {
35
35
  expect(getLinkByHref(links, '/')).to.exist;
@@ -84,7 +84,7 @@ describe('TtNavbar', () => {
84
84
  links?.forEach(l => l.click());
85
85
 
86
86
  await waitUntil(
87
- () => expect(navigateEventCount).to.equal(12),
87
+ () => expect(navigateEventCount).to.equal(13),
88
88
  'navigate event did not fire',
89
89
  );
90
90
  });
@@ -99,13 +99,13 @@ describe('TtNavbar', () => {
99
99
  expect(clientSelector).to.exist;
100
100
  });
101
101
 
102
- it('should render the logout button slot', async () => {
102
+ it('should render the logout link', async () => {
103
103
  const navbar = await fixture<TtNavbar>(
104
- `<tt-navbar client-key=${CLIENT_KEY}><div slot="logoutButton"><button id="logoutBtn">Logout</button></div></tt-navbar>`,
105
- );
104
+ `<tt-navbar client-key=${CLIENT_KEY}></tt-navbar>`);
106
105
 
107
- const logoutBtn = navbar.querySelector('#logoutBtn');
106
+ const links = navbar.shadowRoot?.querySelectorAll('a')
107
+ const logoutLink = getLinkByHref(links!, '/logout');
108
108
 
109
- expect(logoutBtn).to.exist;
109
+ expect(logoutLink).to.exist;
110
110
  })
111
111
  });