commit | 37c7e42a6408faaec5d46802820afa08b6177651 | [log] [tgz] |
---|---|---|
author | Frank Borden <frankborden@google.com> | Fri Aug 19 14:55:52 2022 +0200 |
committer | Frank Borden <frankborden@google.com> | Fri Aug 19 14:55:52 2022 +0200 |
tree | 9218b28916869568f8a62bb4b61869159a54e12f | |
parent | b45e792ad6c94b4f53882ce4a7bba32ce041069b [diff] [blame] |
Convert expect to assert style in tests We primarily use the "TDD" style assert syntax, but had a few cases of the "BDD" style expect syntax in our code (mainly for dom asserts). They are equivalent so we should stick to one. This also reduces our globals (see common-test-setup.ts), which can be further reduced in following changes. https://www.chaijs.com/guide/styles/ Release-Notes: skip Change-Id: I5e18dfd2804a04e66b7699e5967a33fc4cc41398
diff --git a/polygerrit-ui/app/elements/core/gr-smart-search/gr-smart-search_test.ts b/polygerrit-ui/app/elements/core/gr-smart-search/gr-smart-search_test.ts index f269200..aa0071e 100644 --- a/polygerrit-ui/app/elements/core/gr-smart-search/gr-smart-search_test.ts +++ b/polygerrit-ui/app/elements/core/gr-smart-search/gr-smart-search_test.ts
@@ -20,9 +20,10 @@ }); test('renders', () => { - expect(element).shadowDom.to.equal(/* HTML */ ` - <gr-search-bar id="search"> </gr-search-bar> - `); + assert.shadowDom.equal( + element, + /* HTML */ ' <gr-search-bar id="search"> </gr-search-bar> ' + ); }); test('Autocompletes accounts', () => {