Skip to content

Commit

Permalink
Added test to test adding a link
Browse files Browse the repository at this point in the history
  • Loading branch information
wassgha committed Jun 30, 2020
1 parent b989371 commit c4f143e
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -22,7 +22,7 @@ import { useStory } from '../../../app/story';
import { useInsertElement } from '../../canvas';
import { TEXT_ELEMENT_DEFAULT_FONT } from '../../../app/font/defaultFonts';

describe('Canvas keys integration', () => {
describe('Link panel integration', () => {
let fixture;
let element1;

Expand Down Expand Up @@ -70,4 +70,13 @@ describe('Canvas keys integration', () => {
await fixture.events.keyboard.shortcut('mod+k');
expect(linkInput.contains(document.activeElement)).toBeTrue();
});

it('should be able to add a link', async () => {
expect(await getNonBackgroundElementIds()).toEqual([element1.id]);
expect(await getSelection()).toEqual([element1.id]);
const linkInput = fixture.querySelector('[data-testid="link-input-field"]');
expect(linkInput.contains(document.activeElement)).toBeFalse();
await fixture.events.keyboard.shortcut('mod+k');
expect(linkInput.contains(document.activeElement)).toBeTrue();
});
});

0 comments on commit c4f143e

Please sign in to comment.