Skip to content

Instantly share code, notes, and snippets.

@nottyo
Last active August 8, 2020 09:38
Show Gist options
  • Save nottyo/cc86b71c2b597e537ef2888ddd52db53 to your computer and use it in GitHub Desktop.
Save nottyo/cc86b71c2b597e537ef2888ddd52db53 to your computer and use it in GitHub Desktop.
LIFF Component Test with Cypress - app.spec.js
import liff from '@line/liff';
import { mount } from 'cypress-vue-unit-test';
import App from '../../src/App.vue';
describe('App', () => {
before(() => {
Vue.use(VueSweetalert2);
});
it('Initialize LIFF success', () => {
cy.stub(liff, 'init').as('liffInitSuccess').resolves();
mount(App, {
stubs: ['router-link', 'router-view'],
});
cy.get('@liffInitSuccess')
.should('be.calledWithExactly', { liffId: process.env.VUE_APP_LINE_LIFF_ID });
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment