@triptease/tt-navbar 0.0.9 → 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.9",
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,6 +149,11 @@ export class TtNavbar extends LitElement {
149
149
  </details>
150
150
  </div>
151
151
  <slot name="clientSelector"></slot>
152
+ <a
153
+ class="nav-item"
154
+ href=${this.buildUrl('/logout')}
155
+ @click=${this.onAnchorClick}
156
+ >Logout</a>
152
157
  </nav>
153
158
  `;
154
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
  });
@@ -98,4 +98,14 @@ describe('TtNavbar', () => {
98
98
 
99
99
  expect(clientSelector).to.exist;
100
100
  });
101
+
102
+ it('should render the logout link', async () => {
103
+ const navbar = await fixture<TtNavbar>(
104
+ `<tt-navbar client-key=${CLIENT_KEY}></tt-navbar>`);
105
+
106
+ const links = navbar.shadowRoot?.querySelectorAll('a')
107
+ const logoutLink = getLinkByHref(links!, '/logout');
108
+
109
+ expect(logoutLink).to.exist;
110
+ })
101
111
  });