-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- remove unused lines from map-view.js that conflict with test, as the translation returned is a string instead of an object - contains code to be uncommented or adjusted after #324 has been dealt with - remove old spec
- Loading branch information
1 parent
67863e1
commit 3c842ed
Showing
3 changed files
with
54 additions
and
66 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// // Solves the 'RegeneratorRuntime is not defined' issue according to | ||
// // https://stackoverflow.com/questions/28976748/regeneratorruntime-is-not-defined | ||
import '@babel/polyfill' | ||
|
||
import AppLoader from '@/app-loader' | ||
import store from '@/store/store' | ||
import I18nBuilder from '@/i18n/i18n-builder' | ||
import router from '@/router' | ||
import AppRootComponent from '@/App.vue' | ||
import Footer from '@/fragments/footer/Footer' | ||
// TODO: implement global event bus as standalone module | ||
// import EventBus from '@/common/event-bus' | ||
|
||
describe('<App />', () => { | ||
beforeEach(() => { | ||
// // TODO: implement global event bus as standalone module | ||
// cy.spy(EventBus, '$on').as('eventBusRegisterSpy') | ||
// cy.spy(EventBus, '$emit').as('eventBusEmitSpy') | ||
cy.intercept('GET', 'https://*.tile.openstreetmap.org/*/*/*.png', {fixture: 'map-pin.jpg'}) | ||
new AppLoader().fetchApiInitialData() | ||
cy.stub(Footer.computed, 'appVersion', () => { | ||
// appVersion reads from process.env, which isn't available in browser during testing | ||
return 'X.X.X' | ||
}) | ||
cy.mount(AppRootComponent, {i18n: I18nBuilder.build(), store: store, router: router}) | ||
}) | ||
it('renders the app component', () => { | ||
cy.get('.app-content') | ||
cy.get('#map-view') | ||
cy.get('.simple-place-search') | ||
cy.get('.progress-linear').should('have.class', 'progress-linear-disabled') | ||
}) | ||
|
||
it.skip('should toggle progress bar correctly', () => { | ||
// // TODO: implement global event bus as standalone module | ||
// cy.get('@eventBusRegisterSpy').should('have.been.calledWith', 'showLoading') | ||
// cy.get('@eventBusRegisterSpy').should('have.been.calledWith', 'titleChanged') | ||
// cy.get('@eventBusRegisterSpy').should('have.been.calledWith', 'appLoaded') | ||
// cy.get('@eventBusEmitSpy').should('have.been.calledWith', 'titleChanged') | ||
// | ||
// // check progress bar hidden after initial page load and set loading true | ||
// cy.get('.progress-linear').should('have.class', 'progress-linear-disabled').then(() => { | ||
// EventBus.$emit('showLoading', true) | ||
// }) | ||
// cy.get('@eventBusEmitSpy').should('have.been.calledWith', 'showLoading', true) | ||
// | ||
// // check bar is enabled and set loading false again | ||
// cy.get('.progress-linear').should('not.have.class', 'progress-linear-disabled').then(() => { | ||
// EventBus.$emit('showLoading', false) | ||
// }) | ||
// cy.get('@eventBusEmitSpy').should('have.been.calledWith', 'showLoading', false) | ||
// cy.get('.progress-linear').should('have.class', 'progress-linear-disabled') | ||
}) | ||
}) |
This file contains 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
This file was deleted.
Oops, something went wrong.