Skip to content

Commit

Permalink
Fix race for contact details test
Browse files Browse the repository at this point in the history
  • Loading branch information
ericnewcomer committed Aug 11, 2023
1 parent 216a884 commit 11744ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/store/Store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ export class Store extends RapidElement {
const group = this.groups[uuid];
// we treat missing groups as dynamic since the
// api excludes initializing groups
if (!group) {

Check warning on line 326 in src/store/Store.ts

View check run for this annotation

Codecov / codecov/patch

src/store/Store.ts#L326

Added line #L326 was not covered by tests
console.warn('No group for ' + uuid);
}

if (!group || group.query) {
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion test/temba-contact-details.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ describe('temba-contact-tickets', () => {
/\/api\/v2\/contacts.json\?uuid=24d64810-3315-4ff5-be85-48e3fe055bf9/,
'/test-assets/contacts/contact-dave-active'
);
loadStore();
});

it('renders default', async () => {
await loadStore();
const contactDetails: ContactDetails = await getContactDetails({
contact: '24d64810-3315-4ff5-be85-48e3fe055bf9',
});

assert.instanceOf(contactDetails, ContactDetails);
await assertScreenshot('contacts/details', getClip(contactDetails));
});
Expand Down
1 change: 1 addition & 0 deletions test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { expect, fixture, html, assert, waitUntil } from '@open-wc/testing';
import MouseHelper from './MouseHelper';
import { Store } from '../src/store/Store';
import { replace, stub } from 'sinon';
import { CustomEventType } from '../src/interfaces';

export interface CodeMock {
endpoint: RegExp;
Expand Down

0 comments on commit 11744ca

Please sign in to comment.