Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev flag removed for update profile picture button #626

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions app/templates/profile.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,11 @@
alt='user profile'
/>
{{/if}}

{{#if this.isDev}}
<Button @onClick={{this.handleShowEditProfilePictureModal}}
@class='profile-edit-button '
@data-test-btn='edit'>
<FaIcon @icon="edit" />
</Button>
Comment on lines 15 to 19
Copy link
Contributor

@prakashchoudhary07 prakashchoudhary07 Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have tests?

{{else}}
<Button @onClick={{this.handleShowEditProfilePictureModal}}
@class='edit-btn btn'
@data-test-btn='edit'>
Update Picture
</Button>
{{/if}}
</div>
<div class='profile-form-grid'>
{{#if (get @model 'isDeveloper')}}
Expand Down
57 changes: 0 additions & 57 deletions tests/integration/components/profile-test.js

This file was deleted.

22 changes: 22 additions & 0 deletions tests/unit/components/profile-edit-button-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module('Unit | Component | profile-edit-button', function (hooks) {
setupRenderingTest(hooks);

test('profile-edit-button renders and triggers action on click', async function (assert) {
this.set('mockAction', () => {
assert.ok(true, 'Action was called');
});

await render(
hbs`<Button @onClick={{this.mockAction}} @class='profile-edit-button' @data-test-btn='edit'>
<FaIcon @icon="edit" />
</Button>`
);

assert.dom('[data-test-btn="edit"]').exists('Edit button is rendered');
});
});
12 changes: 0 additions & 12 deletions tests/unit/routes/profile-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,4 @@ module('Unit | Route | profile', function (hooks) {
assert.dom('[data-test-modal="image-upload"]').exists();
assert.dom('[data-test-btn="browse"]').exists();
});
test('button appearance based on dev query param', async (assert) => {
await visit('/profile?dev=true');

assert.dom('[data-test-btn="edit"]').exists();
assert.dom('[data-test-btn="edit"]').hasClass('profile-edit-button');

await visit('/profile?dev=false');

assert.dom('[data-test-btn="edit"]').exists();
assert.dom('[data-test-btn="edit"]').hasClass('edit-btn');
assert.dom('[data-test-btn="edit"]').hasText('Update Picture');
});
});
Loading