Skip to content

Commit

Permalink
reenable office test suit
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Nov 7, 2024
1 parent a81a746 commit 6f2e4dd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
7 changes: 5 additions & 2 deletions build/Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,15 @@ Target.create "RunDB" (fun _ ->
module Tests =

let buildSharedTests () = run dotnet [ "build" ] sharedTestsPath
/// This disables microsoft data collection for using `office-addin-mock`
let disableUserData() = run npx [ "office-addin-usage-data"; "off" ] __SOURCE_DIRECTORY__

let Watch() =
[
"server", dotnet [ "watch"; "run" ] serverTestsPath
// This below will start web ui for tests, but cannot execute due to office-addin-mock
"client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npx"; "vite" ] clientTestsPath
// "client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npx"; "mocha"; $"{clientTestsPath}/output/Client.Tests.js" ] clientTestsPath
//"client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npx"; "vite" ] clientTestsPath
"client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npx"; "mocha"; $"{clientTestsPath}/output/Client.Tests.js" ] clientTestsPath
]
|> runParallel

Expand Down Expand Up @@ -387,6 +389,7 @@ let main args =
| _ -> Run(false); 0
| "test" :: a ->
Tests.buildSharedTests()
Tests.disableUserData()
match a with
| "watch" :: _ -> Tests.Watch(); 0
| _ -> Tests.Run(); 0
Expand Down
1 change: 0 additions & 1 deletion src/Client/MainComponents/Cells.fs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ module private CellComponents =
prop.children [Html.i [prop.classes ["fa-sharp"; "fa-solid"; "fa-angles-up"; if isExtended then "fa-rotate-270" else "fa-rotate-90"]; prop.style [style.fontSize(length.em 1)]]]
]


module private CellAux =

let headerTSRSetter (columnIndex: int, s: string, header: CompositeHeader, dispatch) =
Expand Down
2 changes: 1 addition & 1 deletion tests/Client/Client.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let all =
#if FABLE_COMPILER // This preprocessor directive makes editor happy
Shared.Tests.shared
#endif
// OfficeAddin.Tests.Main
OfficeAddin.Tests.Main
client
]

Expand Down
22 changes: 10 additions & 12 deletions tests/Client/OfficeAddin.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ open ExcelJS.Fable.Excel
// ⚠️ These tests do only work on node.js as the office-addin-mock library sents user data to microsoft !!! ⚠️
// Check out https://github.com/OfficeDev/Office-Addin-Scripts/issues/905

// let private TestsBasic = testList "Basic tests" [
// testCaseAsync "develop mock" <| async {
// let testContext: RequestContext = importDefault "./OfficeMockObjects/ExampleObject.js"
// let! result = OfficeInterop.ExcelUtil.getSelectedRangeAdress testContext |> Async.AwaitPromise
// Expect.equal result "C2:G3" "Verify correct setup"
// }
// ]
let private TestsBasic = testList "Basic tests" [
testCaseAsync "develop mock" <| async {
let testContext: RequestContext = importDefault "./OfficeMockObjects/ExampleObject.js"
let! result = OfficeInterop.ExcelUtil.getSelectedRangeAdress testContext |> Async.AwaitPromise
Expect.equal result "C2:G3" "Verify correct setup"
}
]

// let Main = testList "OfficeAddin" [
// TestsBasic
// ]

let x = 0
let Main = testList "OfficeAddin" [
TestsBasic
]

0 comments on commit 6f2e4dd

Please sign in to comment.