-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tab-header): focus problems (#1729)
- Loading branch information
Arturo Castillo Delgado
authored
Apr 17, 2023
1 parent
5c325d9
commit d1ed031
Showing
6 changed files
with
73 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/components/src/components/tab-nav/__snapshots__/tab-nav.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`TabNav should match snapshot 1`] = ` | ||
<scale-tab-nav class="scale-tab-nav" role="tablist"> | ||
<mock:shadow-root> | ||
<div class="tab-nav tab-nav--" part="tab-nav"> | ||
<slot name="tab"></slot> | ||
<slot name="panel"></slot> | ||
</div> | ||
</mock:shadow-root> | ||
</scale-tab-nav> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/components/src/components/tab-nav/tab-nav.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* @license | ||
* Scale https://github.com/telekom/scale | ||
* | ||
* Copyright (c) 2021 Egor Kirpichev and contributors, Deutsche Telekom AG | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
import { newSpecPage } from '@stencil/core/testing'; | ||
import { TabNav } from './tab-nav'; | ||
|
||
describe('TabNav', () => { | ||
let page; | ||
beforeEach(async () => { | ||
page = await newSpecPage({ | ||
components: [TabNav], | ||
html: `<scale-tab-nav></scale-tab-nav>`, | ||
}); | ||
}); | ||
|
||
it('should match snapshot', async () => { | ||
expect(page.root).toMatchSnapshot(); | ||
}); | ||
|
||
// This class seems silly but it's needed in order to make sure we query the element | ||
// since we can never be certain the name of the element will be <scale-tab-nav>. | ||
it('should have default scale-tab-nav class', async () => { | ||
expect(page.root.classList.contains('scale-tab-nav')).toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters