mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 3c6f6af7347d38e87bc6406024e8dcf9e9bce229 (#8962)
* Merge from vscode 3c6f6af7347d38e87bc6406024e8dcf9e9bce229 * skip failing tests * update mac build image
This commit is contained in:
committed by
Karl Burtram
parent
0eaee18dc4
commit
fefe1454de
@@ -8,10 +8,7 @@ import { ScrollbarState } from 'vs/base/browser/ui/scrollbar/scrollbarState';
|
||||
|
||||
suite('ScrollbarState', () => {
|
||||
test('inflates slider size', () => {
|
||||
let actual = new ScrollbarState(0, 14, 0);
|
||||
actual.setVisibleSize(339);
|
||||
actual.setScrollSize(42423);
|
||||
actual.setScrollPosition(32787);
|
||||
let actual = new ScrollbarState(0, 14, 0, 339, 42423, 32787);
|
||||
|
||||
assert.equal(actual.getArrowSize(), 0);
|
||||
assert.equal(actual.getScrollPosition(), 32787);
|
||||
@@ -34,10 +31,7 @@ suite('ScrollbarState', () => {
|
||||
});
|
||||
|
||||
test('inflates slider size with arrows', () => {
|
||||
let actual = new ScrollbarState(12, 14, 0);
|
||||
actual.setVisibleSize(339);
|
||||
actual.setScrollSize(42423);
|
||||
actual.setScrollPosition(32787);
|
||||
let actual = new ScrollbarState(12, 14, 0, 339, 42423, 32787);
|
||||
|
||||
assert.equal(actual.getArrowSize(), 12);
|
||||
assert.equal(actual.getScrollPosition(), 32787);
|
||||
|
||||
@@ -237,6 +237,20 @@ suite('Event', function () {
|
||||
assert.equal(calls, 2);
|
||||
});
|
||||
|
||||
test('Debounce Event - leading reset', async function () {
|
||||
const emitter = new Emitter<number>();
|
||||
let debounced = Event.debounce(emitter.event, (l, e) => l ? l + 1 : 1, 0, /*leading=*/true);
|
||||
|
||||
let calls: number[] = [];
|
||||
debounced((e) => calls.push(e));
|
||||
|
||||
emitter.fire(1);
|
||||
emitter.fire(1);
|
||||
|
||||
await timeout(1);
|
||||
assert.deepEqual(calls, [1, 1]);
|
||||
});
|
||||
|
||||
test('Emitter - In Order Delivery', function () {
|
||||
const a = new Emitter<string>();
|
||||
const listener2Events: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user