Skip to content

Commit

Permalink
added tests for filterSettings util
Browse files Browse the repository at this point in the history
  • Loading branch information
akiran committed Jan 26, 2024
1 parent 8c9488f commit 02629d5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions __tests__/utils/filterSettings.test.js
@@ -0,0 +1,18 @@
import { filterSettings } from "../../src/utils/innerSliderUtils";

describe("filterSettings", () => {
it("returns empty object if there are no valid settings", () => {
expect(filterSettings({})).toEqual({});
expect(filterSettings({ age: 10 })).toEqual({});
});
it("return an object with valid settings and omits extra properties", () => {
expect(filterSettings({ arrows: true, dots: true })).toEqual({
arrows: true,
dots: true
});
expect(filterSettings({ arrows: true, dots: true, age: 10 })).toEqual({
arrows: true,
dots: true
});
});
});

0 comments on commit 02629d5

Please sign in to comment.