* Makes Consumer Apps dictate aasa results * progress with ConsumerApp query * Adds Team ID migration + Stimulus consumer_app_controller.js * Adds cypress tests * Adds Backfill data_update_script + more specs & tweaks * Remove file added by mistake * Comment typo * Small tweaks + improved specs * Update lib/data_update_scripts/20210622145212_backfill_forem_consumer_app_team_id.rb Co-authored-by: Jamie Gaskins <jamie@forem.com> * Update spec/lib/data_update_scripts/backfill_forem_consumer_app_team_id_spec.rb Co-authored-by: rhymes <github@rhymes.dev> * Make use of create! and log errors to ForemStatsClient * Fix specs * Add mock_rpush call as suggested in review * Add Review suggestions * Fix tests * Remove redundant assert in spec Co-authored-by: Jamie Gaskins <jamie@forem.com> Co-authored-by: rhymes <github@rhymes.dev>
46 lines
1.6 KiB
JavaScript
46 lines
1.6 KiB
JavaScript
describe('Consumer Apps', () => {
|
|
beforeEach(() => {
|
|
cy.testSetup();
|
|
cy.fixture('users/adminUser.json').as('user');
|
|
|
|
cy.get('@user').then((user) => {
|
|
cy.loginUser(user);
|
|
cy.visit('/admin/apps/consumer_apps');
|
|
});
|
|
});
|
|
|
|
it('creates a new iOS Consumer App', () => {
|
|
const test_app_bundle = 'com.app.bundle';
|
|
cy.get('.crayons-btn').contains('New Consumer App').click();
|
|
cy.get('#new_consumer_app').as('consumerAppForm');
|
|
cy.get('@consumerAppForm').find('#app_bundle').type(test_app_bundle);
|
|
cy.get('@consumerAppForm').find('#platform').select('iOS');
|
|
|
|
// iOS apps need to provide the option to add a Team ID value
|
|
cy.get('@consumerAppForm').find('#team_id').should('be.visible');
|
|
cy.get('@consumerAppForm').find('#team_id').type('ABC123');
|
|
cy.get('@consumerAppForm')
|
|
.get('.crayons-btn')
|
|
.contains('Create Consumer App')
|
|
.click();
|
|
|
|
cy.findByText(`${test_app_bundle} has been created!`).should('be.visible');
|
|
});
|
|
|
|
it('creates a new Android Consumer App', () => {
|
|
const test_app_bundle = 'com.app.bundle';
|
|
cy.get('.crayons-btn').contains('New Consumer App').click();
|
|
cy.get('#new_consumer_app').as('consumerAppForm');
|
|
cy.get('@consumerAppForm').find('#app_bundle').type(test_app_bundle);
|
|
cy.get('@consumerAppForm').find('#platform').select('Android');
|
|
|
|
// Android apps don't need a Team ID value
|
|
cy.get('@consumerAppForm').find('#team_id').should('not.be.visible');
|
|
cy.get('@consumerAppForm')
|
|
.get('.crayons-btn')
|
|
.contains('Create Consumer App')
|
|
.click();
|
|
|
|
cy.findByText(`${test_app_bundle} has been created!`).should('be.visible');
|
|
});
|
|
});
|