Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
test: fix creating scrollManager scope
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpa9708 authored and David Perez Alvarez committed Nov 2, 2018
1 parent 45965cc commit 48a9a1e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
8 changes: 6 additions & 2 deletions demo/components/window-scroll-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
export default new ScrollUtility(window, {
import scrollManager from "scroll-utility"

scrollManager.updateSettings({
options: {
duration: 600,
duration: 500,
},
})

export default scrollManager
12 changes: 7 additions & 5 deletions demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,24 @@
"sourceMap": true,

"outDir": "./dist",
"rootDir": "./",
"rootDir": "../",

"noImplicitAny": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"noImplicitThis": true,

"baseUrl": ".",
"paths": {
"scroll-utility": ["../dist/index.d.ts"]
},

"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,

"types": ["../dist/index"],

"esModuleInterop": true
},
"exclude": ["webpack.config.ts"]
}
}
5 changes: 5 additions & 0 deletions demo/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function config(env: { NODE_ENV?: string } = {}): Configuration {
const production = env.NODE_ENV !== "development"
return {
mode: production ? "production" : "development",
devtool: "inline-source-map",
entry: resolve(__dirname, "index.tsx"),
output: {
filename: "bundle.js",
Expand All @@ -32,7 +33,11 @@ function config(env: { NODE_ENV?: string } = {}): Configuration {
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".md"],
// alias: {
// "scroll-utility": "../src/index.ts",
// }
},
externals: { "scroll-utility": "ScrollUtility" },
plugins: [new HtmlWebpackPlugin()].concat(
production
? [
Expand Down
8 changes: 4 additions & 4 deletions test/automate/scenarios/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class Scenario {
}
public getManagerInit(elementScroll?: boolean) {
return elementScroll
? `const scrollManager = new ScrollUtility(${Scenario.elementSelector});`
: "const scrollManager = new ScrollUtility();"
? `const scrollManager = new ScrollUtility.Scroll(${Scenario.elementSelector});`
: "const scrollManager = new ScrollUtility.Scroll();"
}
public getScrollOffset(options: IOptions): Promise<number> {
return this.getValue(
Expand Down Expand Up @@ -143,12 +143,12 @@ function testScenarios(getBrowser: () => WebDriver, basicTests: boolean) {
await browser.evaluate(
`${initialize}; scrollManager.centerElement(${
Scenario.elementSelector
}, 50, { horizontal: false })`,
}, 50, { horizontal: false, duration: 0 })`,
)
await browser.evaluate(
`${initialize}; scrollManager.centerElement(${
Scenario.elementSelector
} 50, { horizontal: true })`,
}, 50, { horizontal: true, duration: 0 })`,
)
})
myDirectionDescribe()
Expand Down

0 comments on commit 48a9a1e

Please sign in to comment.