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

Bump @sentry/ember from 7.99.0 to 7.102.1 #7656

Merged
merged 2 commits into from
Feb 23, 2024
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
2 changes: 1 addition & 1 deletion packages/frontend/app/components/link-to-with-action.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<a href={{this.href}} class={{if this.isActive "active"}} {{on "click" this.navigate}} >
<a href={{this.href}} class={{if this.isActive "active"}} {{on "click" this.navigate}} data-test-link-to-with-action>
{{yield}}
</a>
2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@glimmer/tracking": "^1.1.2",
"@percy/cli": "^1.28.0",
"@percy/ember": "^4.2.0",
"@sentry/ember": "7.99.0",
"@sentry/ember": "7.102.1",
"broccoli-asset-rev": "^3.0.0",
"broccoli-file-creator": "^2.1.1",
"broccoli-merge-trees": "^4.2.0",
Expand Down
31 changes: 31 additions & 0 deletions packages/frontend/tests/acceptance/user-menu-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import { setupAuthentication } from 'ilios-common';
import dashboardPage from 'frontend/tests/pages/dashboard';
import myprofilePage from 'frontend/tests/pages/my-profile';

module('Acceptance | user menu', function (hooks) {
setupApplicationTest(hooks);
setupMirage(hooks);

hooks.beforeEach(async function () {
await setupAuthentication({}, true);
});

test('my-profile link is active on my-profile page', async function (assert) {
await myprofilePage.visit();
await myprofilePage.iliosHeader.userMenu.toggle.down();
assert.strictEqual(myprofilePage.iliosHeader.userMenu.links.length, 2);
assert.strictEqual(myprofilePage.iliosHeader.userMenu.links[0].text, 'My Profile');
assert.ok(myprofilePage.iliosHeader.userMenu.links[0].link.isActive);
});

test('my-profile link is not active on dashboard page', async function (assert) {
await dashboardPage.visit();
await dashboardPage.iliosHeader.userMenu.toggle.down();
assert.strictEqual(dashboardPage.iliosHeader.userMenu.links.length, 2);
assert.strictEqual(dashboardPage.iliosHeader.userMenu.links[0].text, 'My Profile');
assert.notOk(dashboardPage.iliosHeader.userMenu.links[0].link.isActive);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { setupIntl } from 'ember-intl/test-support';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import Service from '@ember/service';
import { component } from 'frontend/tests/pages/components/link-to-with-action';

module('Integration | Component | link-to-with-action', function (hooks) {
setupRenderingTest(hooks);
Expand All @@ -16,29 +16,8 @@ module('Integration | Component | link-to-with-action', function (hooks) {
{{this.content}}
</LinkToWithAction>`);

assert.strictEqual(this.element.textContent.trim(), 'Link Text');
assert.strictEqual(this.element.querySelector('a').getAttribute('href'), '/dashboard');
assert.notOk(this.element.querySelector('a').classList.contains('active'));
});

test('it renders active link', async function (assert) {
class RouterMock extends Service {
urlFor() {
return '/here';
}
isActive() {
return true;
}
}

this.owner.register('service:router', RouterMock);
this.set('content', 'More Link Text');
await render(hbs`
<LinkToWithAction @route="somewhere">
{{this.content}}
</LinkToWithAction>`);

assert.strictEqual(this.element.textContent.trim(), 'More Link Text');
assert.ok(this.element.querySelector('a').classList.contains('active'));
assert.strictEqual(component.text, 'Link Text');
assert.strictEqual(component.url, '/dashboard');
assert.notOk(component.isActive);
});
});
2 changes: 2 additions & 0 deletions packages/frontend/tests/pages/components/ilios-header.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { create, text } from 'ember-cli-page-object';
import searchBox from 'frontend/tests/pages/components/global-search-box';
import userMenu from 'frontend/tests/pages/components/user-menu';

const definition = {
scope: '[data-test-ilios-header]',
title: text('[data-test-title]'),
searchBox,
userMenu,
};

export default definition;
Expand Down
11 changes: 11 additions & 0 deletions packages/frontend/tests/pages/components/link-to-with-action.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { attribute, clickable, create, hasClass } from 'ember-cli-page-object';

const definition = {
scope: '[data-test-link-to-with-action]',
url: attribute('href'),
isActive: hasClass('active'),
click: clickable(),
};

export default definition;
export const component = create(definition);
5 changes: 4 additions & 1 deletion packages/frontend/tests/pages/components/user-menu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { create, collection, triggerable } from 'ember-cli-page-object';
import linkToWithAction from 'frontend/tests/pages/components/link-to-with-action';

export default create({
scope: '[data-test-user-menu]',
Expand All @@ -8,5 +9,7 @@ export default create({
down: triggerable('keyup', '', { eventProperties: { key: 'ArrowDown' } }),
esc: triggerable('keyup', '', { eventProperties: { key: 'Escape' } }),
},
links: collection('[data-test-item]', {}),
links: collection('[data-test-item]', {
link: linkToWithAction,
}),
});
7 changes: 7 additions & 0 deletions packages/frontend/tests/pages/my-profile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { create, visitable } from 'ember-cli-page-object';
import iliosHeader from 'frontend/tests/pages/components/ilios-header';

export default create({
visit: visitable('/myprofile'),
iliosHeader,
});
96 changes: 48 additions & 48 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading