-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
1,343 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright 2021 Comcast Cable Communications Management, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { test, expect } from '@jest/globals'; | ||
import { Accessibility } from '../../dist/lib/firebolt'; | ||
|
||
|
||
test('listen', () => { | ||
return Accessibility.listen((event: string, data: object) => { }).then((res: number) => { | ||
expect(res > 0).toBe(true); | ||
}); | ||
}); | ||
|
||
|
||
test('once', () => { | ||
return Accessibility.once((event: string, data: object) => { }).then((res: number) => { | ||
expect(res > 0).toBe(true); | ||
}); | ||
}); | ||
|
||
|
||
test('listen ClosedCaptionsSettings', () => { | ||
return Accessibility.listen((event: 'closedCaptionsSettingsChanged', listener: { data: Accessibility.ClosedCaptionsSettings }) => { }).then((res: number) => { | ||
expect(res > 0).toBe(true); | ||
}); | ||
}); | ||
|
||
|
||
|
||
|
||
test('once ClosedCaptionsSettings', () => { | ||
return Accessibility.once((event: 'closedCaptionsSettingsChanged', listener: { data: Accessibility.ClosedCaptionsSettings }) => { }).then((res: number) => { | ||
expect(res > 0).toBe(true); | ||
}); | ||
}); | ||
|
||
test('listen VoiceGuidanceSettings', () => { | ||
return Accessibility.listen((event: 'closedCaptionsSettingsChanged', listener: { data: Accessibility.VoiceGuidanceSettings }) => { }).then((res: number) => { | ||
expect(res > 0).toBe(true); | ||
}); | ||
}); | ||
|
||
test('once VoiceGuidanceSettings', () => { | ||
return Accessibility.once((event: 'closedCaptionsSettingsChanged', listener: { data: Accessibility.VoiceGuidanceSettings }) => { }).then((res: number) => { | ||
expect(res > 0).toBe(true); | ||
}); | ||
}); | ||
|
||
|
||
test('clear()', () => { | ||
const result: boolean = Accessibility.clear(2); | ||
expect(result).toBeFalsy(); | ||
}); | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright 2021 Comcast Cable Communications Management, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the 'License'); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an 'AS IS' BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { test, expect } from "@jest/globals"; | ||
import { Advertising } from "../../dist/lib/firebolt"; | ||
|
||
test("policy()", () => { | ||
return Advertising.policy().then((policy: Advertising.AdPolicy) => { | ||
expect(policy.skipRestriction).toBe("adsUnwatched"); | ||
expect(policy.limitAdTracking).toBe(false); | ||
}); | ||
}); | ||
|
||
test("config()", () => { | ||
return Advertising.config({ | ||
coppa: true, | ||
environment: "test", | ||
authenticationEntity: "Test", | ||
}).then((res: object) => { | ||
expect(typeof res).toBe("object"); | ||
}); | ||
}); | ||
|
||
test("advertisingId()", () => { | ||
return Advertising.advertisingId().then((res: object) => { | ||
expect(typeof res).toBe("object"); | ||
}); | ||
}); | ||
|
||
test("deviceAttributes()", () => { | ||
return Advertising.deviceAttributes().then((res: object) => { | ||
expect(typeof res).toBe("object"); | ||
}); | ||
}); | ||
|
||
test("appBundleId()", () => { | ||
return Advertising.appBundleId().then((res: string) => { | ||
expect(res).toBe("operator.app"); | ||
expect(typeof res).toBe("string"); | ||
}); | ||
}); | ||
|
||
test("listen()", () => { | ||
return Advertising.listen((event: string, data: object) => {}).then( | ||
(res: number) => { | ||
expect(res > 0).toBe(true); | ||
} | ||
); | ||
}); | ||
|
||
test("once()", () => { | ||
return Advertising.once((event: string, data: object) => {}).then( | ||
(res: number) => { | ||
expect(res > 0).toBe(true); | ||
} | ||
); | ||
}); | ||
|
||
test("listen() specific Advertising event.", () => { | ||
return Advertising.listen("policyChanged", () => {}).then((res: number) => { | ||
expect(res > 0).toBe(true); | ||
}); | ||
}); | ||
|
||
test("once() specific Advertising event.", () => { | ||
return Advertising.once("policyChanged", () => {}).then((res: number) => { | ||
expect(res > 0).toBe(true); | ||
}); | ||
}); | ||
|
||
test("clear()", () => { | ||
const result: boolean = Advertising.clear(2); | ||
expect(result).toBeFalsy(); | ||
}); |
Oops, something went wrong.