diff --git a/packages/design-system/src/css/style.css b/packages/design-system/src/css/style.css index 79ddf318b..6466ff1e5 100644 --- a/packages/design-system/src/css/style.css +++ b/packages/design-system/src/css/style.css @@ -157,6 +157,8 @@ --button-surface: var(--color-white); --button-surface-contrast: var(--color-black); + --subscription-button-gradient: linear-gradient(315deg, rgb(105 230 255 / 0.15) 0%, rgb(99 73 233 / 0.50) 100%), radial-gradient(70.71% 70.71% at 50% 50%, rgb(62 99 222 / 0.15) 0.01%, rgb(66 0 123 / 0.50) 100%), linear-gradient(92deg, #D000FF 0.38%, #B009FE 37.07%, #3E1FFC 65.17%, #009DFF 103.86%), var(--color-button-surface, #2D2E32); + --modal-card-button-surface: var(--color-smoke-300); /* Code styling colors for help menu*/ @@ -258,6 +260,8 @@ --button-active-surface: var(--color-charcoal-600); --button-icon: var(--color-smoke-800); + --subscription-button-gradient: linear-gradient(315deg, rgb(105 230 255 / 0.15) 0%, rgb(99 73 233 / 0.50) 100%), radial-gradient(70.71% 70.71% at 50% 50%, rgb(62 99 222 / 0.15) 0.01%, rgb(66 0 123 / 0.50) 100%), linear-gradient(92deg, #D000FF 0.38%, #B009FE 37.07%, #3E1FFC 65.17%, #009DFF 103.86%), var(--color-button-surface, #2D2E32); + --modal-card-button-surface: var(--color-charcoal-300); --dialog-surface: var(--color-neutral-700); @@ -332,6 +336,7 @@ --color-button-icon: var(--button-icon); --color-button-surface: var(--button-surface); --color-button-surface-contrast: var(--button-surface-contrast); + --color-subscription-button-gradient: var(--subscription-button-gradient); --color-modal-card-button-surface: var(--modal-card-button-surface); --color-dialog-surface: var(--dialog-surface); --color-interface-menu-component-surface-hovered: var( diff --git a/src/components/topbar/CurrentUserPopover.test.ts b/src/components/topbar/CurrentUserPopover.test.ts index 37eba212f..1ad2321da 100644 --- a/src/components/topbar/CurrentUserPopover.test.ts +++ b/src/components/topbar/CurrentUserPopover.test.ts @@ -79,9 +79,11 @@ vi.mock('@/stores/firebaseAuthStore', () => ({ })) // Mock the useSubscription composable +const mockFetchStatus = vi.fn().mockResolvedValue(undefined) vi.mock('@/platform/cloud/subscription/composables/useSubscription', () => ({ useSubscription: vi.fn(() => ({ - isActiveSubscription: vi.fn().mockReturnValue(true) + isActiveSubscription: { value: true }, + fetchStatus: mockFetchStatus })) })) @@ -105,6 +107,15 @@ vi.mock('@/components/common/UserCredit.vue', () => ({ } })) +vi.mock('@/platform/cloud/subscription/components/SubscribeButton.vue', () => ({ + default: { + name: 'SubscribeButtonMock', + render() { + return h('div', 'Subscribe Button') + } + } +})) + describe('CurrentUserPopover', () => { beforeEach(() => { vi.clearAllMocks() @@ -137,9 +148,9 @@ describe('CurrentUserPopover', () => { it('renders logout button with correct props', () => { const wrapper = mountComponent() - // Find all buttons and get the logout button (second one) + // Find all buttons and get the logout button (last button) const buttons = wrapper.findAllComponents(Button) - const logoutButton = buttons[1] + const logoutButton = buttons[4] // Check that logout button has correct props expect(logoutButton.props('label')).toBe('Log Out') @@ -149,9 +160,9 @@ describe('CurrentUserPopover', () => { it('opens user settings and emits close event when settings button is clicked', async () => { const wrapper = mountComponent() - // Find all buttons and get the settings button (first one) + // Find all buttons and get the settings button (third button) const buttons = wrapper.findAllComponents(Button) - const settingsButton = buttons[0] + const settingsButton = buttons[2] // Click the settings button await settingsButton.trigger('click') @@ -167,9 +178,9 @@ describe('CurrentUserPopover', () => { it('calls logout function and emits close event when logout button is clicked', async () => { const wrapper = mountComponent() - // Find all buttons and get the logout button (second one) + // Find all buttons and get the logout button (last button) const buttons = wrapper.findAllComponents(Button) - const logoutButton = buttons[1] + const logoutButton = buttons[4] // Click the logout button await logoutButton.trigger('click') @@ -185,16 +196,16 @@ describe('CurrentUserPopover', () => { it('opens API pricing docs and emits close event when API pricing button is clicked', async () => { const wrapper = mountComponent() - // Find all buttons and get the API pricing button (third one now) + // Find all buttons and get the Partner Nodes info button (first one) const buttons = wrapper.findAllComponents(Button) - const apiPricingButton = buttons[2] + const partnerNodesButton = buttons[0] - // Click the API pricing button - await apiPricingButton.trigger('click') + // Click the Partner Nodes button + await partnerNodesButton.trigger('click') // Verify window.open was called with the correct URL expect(window.open).toHaveBeenCalledWith( - 'https://docs.comfy.org/tutorials/api-nodes/pricing', + 'https://docs.comfy.org/tutorials/api-nodes/overview#api-nodes', '_blank' ) @@ -206,9 +217,9 @@ describe('CurrentUserPopover', () => { it('opens top-up dialog and emits close event when top-up button is clicked', async () => { const wrapper = mountComponent() - // Find all buttons and get the top-up button (last one) + // Find all buttons and get the top-up button (second one) const buttons = wrapper.findAllComponents(Button) - const topUpButton = buttons[buttons.length - 1] + const topUpButton = buttons[1] // Click the top-up button await topUpButton.trigger('click') diff --git a/src/components/topbar/CurrentUserPopover.vue b/src/components/topbar/CurrentUserPopover.vue index dce81dffb..5bedaa114 100644 --- a/src/components/topbar/CurrentUserPopover.vue +++ b/src/components/topbar/CurrentUserPopover.vue @@ -23,6 +23,38 @@ +
+
+ +
+
+ +