diff --git a/docs/schemas.md b/docs/schemas.md index 9ef00089..56ed6acd 100644 --- a/docs/schemas.md +++ b/docs/schemas.md @@ -62,12 +62,14 @@ The Call-to-action (CTA) block encapsulates the following components: When the button is clicked, the component will: * Fire the named event if defined (see schema definition) -* Remove the button +* Disable the button #### Schema definition +Default styling + ```html -
CTA block content
@@ -79,18 +81,39 @@ When the button is clicked, the component will:CTA block content
+Click button to see solution
+This color of this text is black.
+``` + +--- + +## Green Bold Text + +This class should be used to apply the following to text: green, bold, and 24px. + +**Example** + +This text is green, bold, and 24px.
+``` + +--- + ## Responsive Media Improve image responsiveness by adding a maximum width and allowing the browser to calculate and select a height for the image. As a general rule, the max width will be 100% of the containing block's width. diff --git a/specs/content-templates.spec.ts b/specs/content-templates.spec.ts index db70d953..9c540b70 100644 --- a/specs/content-templates.spec.ts +++ b/specs/content-templates.spec.ts @@ -31,7 +31,7 @@ test('segmented content template works', async ({ page }) => {Want to see more?
This is the content for block 2
Prompt
'} fireEvent={'Event'}/> ) - fireEvent.click(screen.getByText('Click me!')) - expect(screen.queryByText('Click me!')).toBeNull() + const button = screen.getByText('Click me!') + fireEvent.click(button) + expect(button.className).toBe('os-submit-button-default-theme') + expect(button).toBeDisabled() + screen.getByText('String') + expect(screen.queryByText('Prompt')) +}) + +test('CTABlock container and button styled when styleTheme prop provided, disables on click, prompt remains', async () => { + const { container } = render( +Prompt
'} styleTheme={'green'} fireEvent={'Event'}/> + ) + + const div = container.querySelector("div.os-cta-container-green-theme") + expect(div?.className).toBe('os-cta-container-green-theme') + const button = screen.getByText('Click me!') + fireEvent.click(button) + expect(button.className).toBe('os-submit-button-green-theme') + expect(button).toBeDisabled() screen.getByText('String') expect(screen.queryByText('Prompt')) })