describe('deprecated.plugin', () => {
it('Property: Should throw an error
if the deprecated prop is used',
() => {
…
});
});
Slide 16
Slide 16 text
No content
Slide 17
Slide 17 text
describe('Context menu', () => {
it('should open the context menu on click', async () => {
const wrapper = createWrapper();
expect(wrapper.vm).toBeTruthy();
await wrapper.trigger('click');
const selector = '.sw-context-menu';
expect(wrapper.find(selector).isVisible()).toBeTruthy();
});
});
Slide 18
Slide 18 text
describe('Context menu', () => {
it('should open the context menu on click', () => {
});
});
Slide 19
Slide 19 text
describe('Context menu', () => {
it('should open the context menu on click', () => {
});
});
// Arrange
const wrapper = createWrapper();
const selector = '.sw-context-menu';
Slide 20
Slide 20 text
describe('Context menu', () => {
it('should open the context menu on click', () => {
});
});
// Arrange
const wrapper = createWrapper();
const selector = '.sw-context-menu';
// Act
await wrapper.trigger('click');
Slide 21
Slide 21 text
describe('Context menu', () => {
it('should open the context menu on click', () => {
});
});
// Arrange
const wrapper = createWrapper();
const selector = '.sw-context-menu';
// Act
await wrapper.trigger('click');
// Assert
expect(wrapper.vm).toBeTruthy();
expect(wrapper.find(selector).isVisible()).toBeTruthy();
Slide 22
Slide 22 text
No content
Slide 23
Slide 23 text
No content
Slide 24
Slide 24 text
“…arrange my test == what I’m given.”
Slide 25
Slide 25 text
“…arrange my test == what I’m given.”
“…act in my test == when something happens.”
Slide 26
Slide 26 text
“…arrange my test == what I’m given.”
“…act in my test == when something happens.”
“…assert the results == something happens
then this is what I expect as the outcome.”
Slide 27
Slide 27 text
“…arrange my test == what I’m given.”
“…act in my test == when something happens.”
“…assert the results == something happens
then this is what I expect as the outcome.”
Slide 28
Slide 28 text
describe('Context menu', () => {
it('should open the context menu on click', () => {
// Given
const contextButtonSelector = 'sw-context-button';
const contextMenuSelector = '.sw-context-menu';
// When
let contextMenu = wrapper.find(contextMenuSelector);
expect(contextMenu.isVisible()).toBe(false);
const contextButton = wrapper.find(contextButtonSelector);
await contextButton.trigger('click');
// Then
contextMenu = wrapper.find(contextMenuSelector);
expect(contextMenu.isVisible()).toBe(true);
});
});