@memberjunction/ng-tabstrip 5.41.0 → 5.43.0
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab-strip.component.dom.test.d.ts","sourceRoot":"","sources":["../../../src/lib/tab-strip/tab-strip.component.dom.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { renderTemplate } from '@memberjunction/ng-test-utils';
|
|
4
|
+
import { MJTabStripComponent } from './tab-strip.component';
|
|
5
|
+
import { MJTabComponent } from '../tab/tab.component';
|
|
6
|
+
import { MJTabBodyComponent } from '../tab-body/tab-body.component';
|
|
7
|
+
/**
|
|
8
|
+
* DOM-level spec for <mj-tabstrip> — a *compound* component: it only does anything
|
|
9
|
+
* with projected <mj-tab>/<mj-tab-body> children, and its parts are module-declared.
|
|
10
|
+
*
|
|
11
|
+
* We use the shared `renderTemplate` helper, which wraps the markup in a host
|
|
12
|
+
* component, declares the components, and waits for the tab-strip's async refresh
|
|
13
|
+
* to settle — so the spec stays focused on behavior, not test plumbing.
|
|
14
|
+
*/
|
|
15
|
+
const TABSTRIP_MARKUP = `
|
|
16
|
+
<mj-tabstrip>
|
|
17
|
+
<mj-tab Name="A">Tab A</mj-tab>
|
|
18
|
+
<mj-tab Name="B">Tab B</mj-tab>
|
|
19
|
+
<mj-tab-body>Body A</mj-tab-body>
|
|
20
|
+
<mj-tab-body>Body B</mj-tab-body>
|
|
21
|
+
</mj-tabstrip>`;
|
|
22
|
+
function renderTabStrip() {
|
|
23
|
+
return renderTemplate(TABSTRIP_MARKUP, {
|
|
24
|
+
imports: [CommonModule],
|
|
25
|
+
declarations: [MJTabStripComponent, MJTabComponent, MJTabBodyComponent],
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
describe('MJTabStripComponent (DOM)', () => {
|
|
29
|
+
it('renders both tab headers, with the first selected by default', async () => {
|
|
30
|
+
const fixture = await renderTabStrip();
|
|
31
|
+
const tabs = fixture.nativeElement.querySelectorAll('.single-tab');
|
|
32
|
+
expect(tabs.length).toBe(2);
|
|
33
|
+
expect(tabs[0].classList.contains('single-tab-selected')).toBe(true);
|
|
34
|
+
expect(tabs[1].classList.contains('single-tab-selected')).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
it('selects the second tab and shows its body when its header is clicked', async () => {
|
|
37
|
+
const fixture = await renderTabStrip();
|
|
38
|
+
const tabs = fixture.nativeElement.querySelectorAll('.single-tab');
|
|
39
|
+
tabs[1].click();
|
|
40
|
+
await fixture.whenStable();
|
|
41
|
+
expect(tabs[1].classList.contains('single-tab-selected')).toBe(true);
|
|
42
|
+
expect(tabs[0].classList.contains('single-tab-selected')).toBe(false);
|
|
43
|
+
const bodies = fixture.nativeElement.querySelectorAll('.tab-body');
|
|
44
|
+
expect(bodies[1].hidden).toBe(false);
|
|
45
|
+
expect(bodies[0].hidden).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=tab-strip.component.dom.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab-strip.component.dom.test.js","sourceRoot":"","sources":["../../../src/lib/tab-strip/tab-strip.component.dom.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;;;;;;GA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,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEtE,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;QACnE,MAAM,CAAE,MAAM,CAAC,CAAC,CAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtD,MAAM,CAAE,MAAM,CAAC,CAAC,CAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect } from 'vitest';\nimport { CommonModule } from '@angular/common';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { renderTemplate } from '@memberjunction/ng-test-utils';\nimport { MJTabStripComponent } from './tab-strip.component';\nimport { MJTabComponent } from '../tab/tab.component';\nimport { MJTabBodyComponent } from '../tab-body/tab-body.component';\n\n/**\n * DOM-level spec for <mj-tabstrip> — a *compound* component: it only does anything\n * with projected <mj-tab>/<mj-tab-body> children, and its parts are module-declared.\n *\n * We use the shared `renderTemplate` helper, which wraps the markup in a host\n * component, declares the components, and waits for the tab-strip's async refresh\n * to settle — so the spec stays focused on behavior, not test plumbing.\n */\nconst TABSTRIP_MARKUP = `\n <mj-tabstrip>\n <mj-tab Name=\"A\">Tab A</mj-tab>\n <mj-tab Name=\"B\">Tab B</mj-tab>\n <mj-tab-body>Body A</mj-tab-body>\n <mj-tab-body>Body B</mj-tab-body>\n </mj-tabstrip>`;\n\nfunction renderTabStrip(): Promise<ComponentFixture<unknown>> {\n return renderTemplate(TABSTRIP_MARKUP, {\n imports: [CommonModule],\n declarations: [MJTabStripComponent, MJTabComponent, MJTabBodyComponent],\n });\n}\n\ndescribe('MJTabStripComponent (DOM)', () => {\n it('renders both tab headers, with the first selected by default', async () => {\n const fixture = await renderTabStrip();\n const tabs = fixture.nativeElement.querySelectorAll('.single-tab');\n\n expect(tabs.length).toBe(2);\n expect(tabs[0].classList.contains('single-tab-selected')).toBe(true);\n expect(tabs[1].classList.contains('single-tab-selected')).toBe(false);\n });\n\n it('selects the second tab and shows its body when its header is clicked', async () => {\n const fixture = await renderTabStrip();\n const tabs = fixture.nativeElement.querySelectorAll('.single-tab');\n\n (tabs[1] as HTMLElement).click();\n await fixture.whenStable();\n\n expect(tabs[1].classList.contains('single-tab-selected')).toBe(true);\n expect(tabs[0].classList.contains('single-tab-selected')).toBe(false);\n\n const bodies = fixture.nativeElement.querySelectorAll('.tab-body');\n expect((bodies[1] as HTMLElement).hidden).toBe(false);\n expect((bodies[0] as HTMLElement).hidden).toBe(true);\n });\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-tabstrip",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.43.0",
|
|
4
4
|
"description": "DEPRECATED: Simple tab strip component. Use Kendo TabStrip or mj-collapsible-panel instead.",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@angular/compiler": "21.1.3",
|
|
20
20
|
"@angular/compiler-cli": "21.1.3",
|
|
21
|
+
"@memberjunction/ng-test-utils": "5.43.0",
|
|
21
22
|
"vitest": "^4.0.18"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"@angular/core": "21.1.3"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@memberjunction/ng-container-directives": "5.
|
|
29
|
+
"@memberjunction/ng-container-directives": "5.43.0",
|
|
29
30
|
"tslib": "^2.8.1"
|
|
30
31
|
},
|
|
31
32
|
"sideEffects": false,
|