Skip to content

Commit c075f7a

Browse files
committed
test: modify for table test
1 parent 4e28737 commit c075f7a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

__tests__/modify-exisiting-table.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Automizer from '../src/index';
1+
import Automizer, { modify } from '../src/index';
22

33
test('create presentation, add and modify an existing table.', async () => {
44
const automizer = new Automizer({
@@ -42,10 +42,12 @@ test('create presentation, add and modify an existing table.', async () => {
4242
row.forEach((cell,c) => {
4343
const tabCell = tabRow.getElementsByTagName('a:tc')[c]
4444

45-
// We can hopefully found a corresponding text node
46-
// and update textContent by our own label.
47-
tabCell.getElementsByTagName('a:t')
48-
[0].firstChild.textContent = String(cell.label)
45+
// We could hopefully find a corresponding text node
46+
// and replace textContent with our own label.
47+
if(cell.label !== undefined) {
48+
tabCell.getElementsByTagName('a:t')
49+
[0].firstChild.textContent = String(cell.label)
50+
}
4951
})
5052
})
5153
});

0 commit comments

Comments
 (0)