This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { mount } from "@vue/test-utils"; | |
import Home from "../Home.vue"; | |
describe('Home page', () => { | |
it('render html correctly', () => { | |
const wrapper = mount(Home); | |
expect(wrapper.html()).toMatchSnapshot(); | |
}); | |
it('Should change the status text to `Success` if login succeeds', async() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { shallowMount } from "@vue/test-utils"; | |
import Login from "../Login.vue"; | |
describe('Login component', () => { | |
it('render html correctly', () => { | |
const wrapper = mount(Login); | |
expect(wrapper.html()).toMatchSnapshot(); | |
}); | |
it('Should emit `failed` if the login failed', async() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jest.config.js | |
module.exports = { | |
"moduleFileExtensions": [ | |
"js", | |
"json", | |
// tell Jest to handle `*.vue` files | |
"vue" | |
], | |
"transform": { | |
// process `*.vue` files with `vue-jest` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"test": "NODE_ENV=test TEST_CLASS=unit jest", | |
"integration-test": "NODE_ENV=test TEST_CLASS=integration jest" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AfterViewInit, Directive, ElementRef } from '@angular/core'; | |
@Directive({ | |
selector: '[appUnwraptag]', | |
}) | |
export class UnwrapTagDirective implements AfterViewInit { | |
constructor(private el: ElementRef) {} | |
ngAfterViewInit() { | |
// get the element's parent node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Put this file in wordpress root directory . | |
POST parameters should contain : | |
title = for post title , | |
content = for post content , | |
cat_id = for category ID , | |
imgUrl = for featured image URL . (url must end with .jpg , .png or .gif) |