Skip to content

Commit 0db05fc

Browse files
committed
WIP
1 parent 8b603b9 commit 0db05fc

File tree

2 files changed

+27
-44
lines changed

2 files changed

+27
-44
lines changed

packages/compass-generative-ai/src/components/ai-optin-modal.spec.tsx

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,7 @@ describe('AIOptInModal Component', function () {
7070
</PreferencesProvider>
7171
);
7272
const button = screen.getByText('Use AI Features').closest('button');
73-
expect(button?.getAttribute('aria-disabled')).to.equal('false');
74-
});
75-
76-
it('should disable the opt in button if project AI setting is disabled', async function () {
77-
await mockPreferences.savePreferences({
78-
enableGenAIFeaturesAtlasProject: false,
79-
});
80-
render(
81-
<PreferencesProvider value={mockPreferences}>
82-
<AIOptInModal
83-
projectId="ab123"
84-
isOptInModalVisible={true}
85-
isOptInInProgress={false}
86-
onOptInModalClose={() => {}}
87-
onOptInClick={() => {}}
88-
>
89-
{' '}
90-
</AIOptInModal>
91-
</PreferencesProvider>
92-
);
93-
const button = screen.getByText('Use AI Features').closest('button');
94-
expect(button?.style.cursor).to.equal('not-allowed');
73+
expect(button?.style.cursor).to.not.equal('not-allowed');
9574
});
9675

9776
describe('conditional banner messages', function () {

packages/compass-generative-ai/src/components/ai-optin-modal.tsx

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,34 +62,38 @@ const focusBoxShadow = (color: string) => `
6262
`;
6363
const disabledButtonStyles: Record<Theme, string> = {
6464
[Theme.Light]: css`
65-
&,
66-
${hoverSelector}, ${activeSelector} {
67-
background-color: ${palette.gray.light2};
68-
border-color: ${palette.gray.light1};
69-
color: ${palette.gray.base};
70-
box-shadow: none;
71-
cursor: not-allowed;
72-
}
65+
button {
66+
&,
67+
${hoverSelector}, ${activeSelector} {
68+
background-color: ${palette.gray.light2};
69+
border-color: ${palette.gray.light1};
70+
color: ${palette.gray.base};
71+
box-shadow: none;
72+
cursor: not-allowed;
73+
}
7374
74-
${focusSelector} {
75-
color: ${palette.gray.base};
76-
box-shadow: ${focusBoxShadow(palette.white)};
75+
${focusSelector} {
76+
color: ${palette.gray.base};
77+
box-shadow: ${focusBoxShadow(palette.white)};
78+
}
7779
}
7880
`,
7981

8082
[Theme.Dark]: css`
81-
&,
82-
${hoverSelector}, ${activeSelector} {
83-
background-color: ${palette.gray.dark3};
84-
border-color: ${palette.gray.dark2};
85-
color: ${palette.gray.dark1};
86-
box-shadow: none;
87-
cursor: not-allowed;
88-
}
83+
button {
84+
&,
85+
${hoverSelector}, ${activeSelector} {
86+
background-color: ${palette.gray.dark3};
87+
border-color: ${palette.gray.dark2};
88+
color: ${palette.gray.dark1};
89+
box-shadow: none;
90+
cursor: not-allowed;
91+
}
8992
90-
${focusSelector} {
91-
color: ${palette.gray.dark1};
92-
box-shadow: ${focusBoxShadow(palette.black)};
93+
${focusSelector} {
94+
color: ${palette.gray.dark1};
95+
box-shadow: ${focusBoxShadow(palette.black)};
96+
}
9397
}
9498
`,
9599
};

0 commit comments

Comments
 (0)