Skip to content

Commit d615103

Browse files
committed
update tests
1 parent 2ef776b commit d615103

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

src/util/scrollbar.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ export const setScrollbar = (element: Element, overflow?: boolean) => {
7171
const bd = getDocumentBody(element);
7272
const bodyPad = parseInt(getElementStyle(bd, "paddingRight"), 10);
7373
const isOpen = getElementStyle(bd, "overflow") === "hidden";
74-
const sbWidth = isOpen && bodyPad ? 0 : measureScrollbar(element);
74+
const sbWidth = isOpen && bodyPad
75+
? /* istanbul ignore next */ 0
76+
: measureScrollbar(element);
7577
const fixedItems = getFixedItems(bd);
7678

7779
// istanbul ignore if @preserve

test/assets/bootstrap.min.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -11482,7 +11482,7 @@ textarea.form-control-lg {
1148211482
.fade,
1148311483
.collapsing,
1148411484
.carousel-item {
11485-
transition-duration: 100ms;
11485+
transition-duration: 50ms;
1148611486
}
1148711487

1148811488
.modal, .offcanvas, .tooltip, .popover { transition-duration: 0.05s }

test/offcanvas.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ describe("Offcanvas Class Tests", () => {
7474
await vi.waitFor(() => {
7575
expect(instance.element.className).to.contain("show");
7676
}, 151);
77+
await new Promise(res => setTimeout(res, 151));
7778

7879
dismiss.click();
7980
await vi.waitFor(() => {

test/tab.test.ts

+11-10
Original file line numberDiff line numberDiff line change
@@ -78,39 +78,40 @@ describe("Tab Class Tests", () => {
7878
dropdowns.forEach(dropdown => dropdownInstances.push(Dropdown.init(dropdown)));
7979
elements.forEach(element => tabInstances.push(Tab.init(element)));
8080

81-
(dropdownInstances[0].element as HTMLElement).click();
81+
dropdownInstances[0].element.click();
8282
await vi.waitFor(() => {
8383
expect(dropdownInstances[0].menu.className).to.contain('show');
84-
}, 50);
85-
(tabInstances[1].element as HTMLElement).click();
84+
}, 150);
85+
tabInstances[1].element.click();
8686
await vi.waitFor(() => {
8787
expect(tabInstances[0].content?.className).to.not.contain('show');
8888
expect(tabInstances[1].content?.className).to.contain('show');
8989
}, 151);
9090

9191
await new Promise(res => setTimeout(res, 101));
92-
(dropdownInstances[0].element as HTMLElement).click();
92+
dropdownInstances[0].element.click();
9393
await vi.waitFor(() => {
9494
expect(dropdownInstances[0].menu.className).to.contain('show');
95-
}, 50);
95+
}, 150);
96+
9697
await new Promise(res => setTimeout(res, 171));
97-
(tabInstances[2].element as HTMLElement).click();
98+
tabInstances[2].element.click();
9899
await vi.waitFor(() => {
99100
expect(tabInstances[1].content?.className).to.not.contain('show');
100101
expect(tabInstances[2].content?.className).to.contain('show');
101-
}, 151);
102+
}, 171);
102103

103104
await new Promise(res => setTimeout(res, 101));
104-
(tabInstances[4].element as HTMLElement).click();
105+
tabInstances[4].element.click();
105106
await vi.waitFor(() => {
106107
expect(tabInstances[4].content?.className).to.contain('show');
107108
}, 151);
108109

109-
(tabInstances[3].element as HTMLElement).click();
110+
tabInstances[3].element.click();
110111
await vi.waitFor(() => {
111112
expect(tabInstances[4].content?.className).to.not.contain('show');
112113
expect(tabInstances[3].content?.className).to.contain('show');
113-
}, 151);
114+
}, 171);
114115
});
115116

116117
it("Can do original events", async () => {

0 commit comments

Comments
 (0)