diff --git a/cypress.config.ts b/cypress.config.ts
index 9981236..b8a1031 100644
--- a/cypress.config.ts
+++ b/cypress.config.ts
@@ -12,6 +12,7 @@ export default defineConfig({
baseUrl: 'http://0.0.0.0:4200',
reactiveFormUrl: 'http://0.0.0.0:4200/reactive-form-example',
templateDrivenFormUrl: 'http://0.0.0.0:4200/template-driven-form-example',
+ languageOptionUrl: 'http://0.0.0.0:4200/language-option-example',
},
e2e: {
setupNodeEvents(on, config) {
diff --git a/cypress/e2e/ngx-turnstile.cy.ts b/cypress/e2e/ngx-turnstile.cy.ts
index 583c8d7..745f3ba 100644
--- a/cypress/e2e/ngx-turnstile.cy.ts
+++ b/cypress/e2e/ngx-turnstile.cy.ts
@@ -31,4 +31,18 @@ describe('tests the ngx-turnstile library', () => {
'[Cloudflare Turnstile] Turnstile already has been loaded. Was Turnstile imported multiple times?.',
);
});
+
+ it('Passes Language Option Example', () => {
+ cy.visit(Cypress.env('languageOptionUrl'));
+ cy.wait(3000);
+ cy.get('ngx-turnstile').should('have.attr', 'ng-reflect-language', 'FR');
+
+ // checks the iframe src attribute to make sure the language option was sent to cloudflare correctly
+ cy.get('ngx-turnstile div')
+ .shadow()
+ .find('iframe')
+ .then(($iframe) => {
+ cy.wrap($iframe).should('have.attr', 'src').and('include', 'FR');
+ });
+ });
});
diff --git a/projects/ngx-turnstile-demo/src/app/app.component.ts b/projects/ngx-turnstile-demo/src/app/app.component.ts
index 5539c25..77d829f 100644
--- a/projects/ngx-turnstile-demo/src/app/app.component.ts
+++ b/projects/ngx-turnstile-demo/src/app/app.component.ts
@@ -74,6 +74,12 @@ import { RouterModule } from '@angular/router';
[routerLinkActive]="['route-active']"
>Template Driven Form Example
+
+ Language Option Example