name:
src/test/js/execution/ExecutorSupportedInfoFormulasTest.ts
-rw-r--r--
2042
1import { NAException } from "../../../main/js/errors/NAException";
2import { runner, it, describe } from "../testutils/TestUtils";
3
4describe("Executor.execute - Info Formulas", function () {
5 it("should support ERRORTYPE", function () {
6 runner().addCell("Alpha", "A1", "=ERRORTYPE(#DIV/0!)").addExpectedValue("Alpha", "A1", 2).run();
7 });
8
9 it("should support ISBLANK", function () {
10 runner().addCell("Alpha", "A1", "=ISBLANK(G20)").addExpectedValue("Alpha", "A1", true).run();
11 });
12
13 it("should support ISERR", function () {
14 runner().addCell("Alpha", "A1", "=ISERR(1/0)").addExpectedValue("Alpha", "A1", true).run();
15 });
16
17 it("should support ISERROR", function () {
18 runner().addCell("Alpha", "A1", "=ISERROR(1/0)").addExpectedValue("Alpha", "A1", true).run();
19 });
20
21 it("should support ISLOGICAL", function () {
22 runner().addCell("Alpha", "A1", "=ISLOGICAL(1)").addExpectedValue("Alpha", "A1", false).run();
23 });
24
25 it("should support ISNA", function () {
26 runner().addCell("Alpha", "A1", "=ISNA(#N/A)").addExpectedValue("Alpha", "A1", true).run();
27 });
28
29 it("should support ISNONTEXT", function () {
30 runner()
31 .addCell("Alpha", "A1", "=ISNONTEXT(TRUE())")
32 .addExpectedValue("Alpha", "A1", true)
33 .run();
34 });
35
36 it("should support ISNUMBER", function () {
37 runner().addCell("Alpha", "A1", "=ISNUMBER(1)").addExpectedValue("Alpha", "A1", true).run();
38 });
39
40 it("should support ISTEXT", function () {
41 runner()
42 .addCell("Alpha", "A1", '=ISTEXT("Text Here.")')
43 .addExpectedValue("Alpha", "A1", true)
44 .run();
45 });
46
47 it("should support N", function () {
48 runner().addCell("Alpha", "A1", "=N(1)").addExpectedValue("Alpha", "A1", 1).run();
49 });
50
51 it("should support NA", function () {
52 runner()
53 .addCell("Alpha", "A1", "=NA()")
54 .addExpectedValue("Alpha", "A1", new NAException())
55 .run();
56 });
57
58 it("should support TYPE", function () {
59 runner().addCell("Alpha", "A1", "=TYPE(99)").addExpectedValue("Alpha", "A1", 1).run();
60 });
61});