-
Notifications
You must be signed in to change notification settings - Fork 6.7k
/
radio-harness.spec.ts
31 lines (22 loc) · 984 Bytes
/
radio-harness.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import {MatLegacyRadioGroupHarness} from '@angular/material/legacy-radio/testing';
import {SeleniumWebDriverHarnessEnvironment} from '@angular/cdk/testing/selenium-webdriver';
import {HarnessLoader} from '@angular/cdk/testing';
import {configureDriver} from './driver.js';
// Tests are flaky on CI unless we increase the timeout.
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10_000; // 10 seconds
describe('app test', () => {
let loader: HarnessLoader;
beforeEach(async () => {
const driver = await configureDriver();
await driver.get('http://localhost:4200');
loader = SeleniumWebDriverHarnessEnvironment.loader(driver);
});
it('should work', async () => {
const group = await loader.getHarness(MatLegacyRadioGroupHarness);
expect(group).toBeDefined();
expect(await group.getCheckedValue()).toBe(null);
const buttons = await group.getRadioButtons();
await buttons[1].check();
expect(await group.getCheckedValue()).toBe('second');
});
});