Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should work a first name', async () => {
element.first = 'Peter';
await flush(element);
expect(element.textContent).toEqual('Hello, my name is Peter ');
});
it('should show the message and image', async () => {
element.text = 'A text';
element.image = 'http://localhost/image.jpg';
await flush(element);
expect(element.textContent).toEqual('A text');
expect(element.getElementsByTagName('img')[0].attributes.getNamedItem('src').value).toEqual('http://localhost/image.jpg');
});
});
it('should work with both a first and a last name', async () => {
element.first = 'Peter';
element.last = 'Parker';
await flush(element);
expect(element.textContent.trim()).toEqual('Hello, World! I\'m Peter Parker');
});
});
it('should not render any content if there is not a match', async () => {
await flush(element);
expect(element.textContent).toEqual('');
})