From b7e46da3e9bc8ffe0aea9a85f09a625574b7fd6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Wed, 19 Aug 2026 12:32:21 -0600 Subject: [PATCH] Add test for new Nostr connect location --- .../contributions-timeline-test.gjs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/integration/components/contributions-timeline-test.gjs b/tests/integration/components/contributions-timeline-test.gjs index 682025d..e639508 100644 --- a/tests/integration/components/contributions-timeline-test.gjs +++ b/tests/integration/components/contributions-timeline-test.gjs @@ -1,14 +1,23 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'marco/tests/helpers'; import { render, click } from '@ember/test-helpers'; +import Service from '@ember/service'; import ContributionsTimeline from 'marco/components/contributions-timeline'; +import { setupNostrMocks } from 'marco/tests/helpers/mock-nostr'; function noop() {} +class MockToastService extends Service { + show() {} +} + module('Integration | Component | contributions-timeline', function (hooks) { setupRenderingTest(hooks); + setupNostrMocks(hooks); hooks.beforeEach(function () { + this.owner.register('service:toast', MockToastService); + this.noop = noop; this.emptyItems = []; }); @@ -48,6 +57,28 @@ module('Integration | Component | contributions-timeline', function (hooks) { assert.dom('.empty-state').includesText('Connect your Nostr account'); }); + test('clicking "Connect your Nostr account" opens the Nostr connect modal', async function (assert) { + await render( + + ); + + assert.dom('.nostr-connect-modal').doesNotExist(); + + await click('.empty-state a'); + + assert.dom('.nostr-connect-modal').exists(); + }); + test('it renders an empty state when connected but no contributions', async function (assert) { await render(