Skip to content

Commit e402623

Browse files
committed
fix(creator): update empty dom
1 parent bff4d90 commit e402623

File tree

3 files changed

+58
-66
lines changed

3 files changed

+58
-66
lines changed

src/helpers/creator.helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const getBirthdayInfo = (
4343
};
4444

4545
export const getBio = (el: HTMLElement | null): string => {
46-
return el.querySelector('.article-content p').text.trim().split('\n')[0].trim();
46+
return el.querySelector('.article-content p')?.text.trim().split('\n')[0].trim() || null;
4747
};
4848

4949
export const getPhoto = (el: HTMLElement | null): string => {

tests/creator.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ describe('Composer info', () => {
146146

147147
test('Bio', () => {
148148
const creator = getBio(asideNodeComposer);
149-
expect(creator).toEqual<string>('Tento tvůrce zatím nemá přidanou biografii.');
149+
expect(creator).toEqual<string>(null);
150150
});
151151

152152
test('Photo', () => {

0 commit comments

Comments
 (0)