Last active
August 8, 2020 09:38
-
-
Save nottyo/cc86b71c2b597e537ef2888ddd52db53 to your computer and use it in GitHub Desktop.
LIFF Component Test with Cypress - app.spec.js
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 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